Jump to content

Unexpected Session Variable Update


SixPath

Recommended Posts

im trying to make a breadcrumbs feature on my site. this feature is driven using the session variables. My problem here is that.. i just wondering what make the session variables display its own value (not expected value).. this variable name got no similar across the whole site.

 

 

i just wanna hear what are the possible causes why this happen...

 

 

thanks

Link to comment
Share on other sites

Can you give an example of it's "own value"? Sessions don't really sound like the right solution for breadcrumbs, they're really just suited to data that will last for the session (as the name kind of implies), or data that needs to be carried between a number of pages. Breadcrumbs generally should be generated for that specific page only.

 

What I imagine is happening is that the breadcrumbs are being set on one page (maybe incorrectly set), that is carrying on to the next page and not being overwritten (or incorrectly set again). Though with no code examples or further information on how they're implemented, can't really help you.

Link to comment
Share on other sites

 <ul>
              <li><a href="<?php echo SITE_URL?>">Home</a> &#187;</li>
              <li>
                                       <a href="<?php echo SITE_URL?>/<?php echo $_SESSION[crumbs][src]?>.html">
                                       <?php echo str_replace("-"," ",$_SESSION[crumbs][src]); ?></a>
                                       &#187;
              </li>
              <li><a href="<?php echo SITE_URL?>/products/<?php echo $_GET[prod_id]?>"><?php echo $_GET[prod_id]?></a></li>
</ul> 

         

 

 

Link to comment
Share on other sites

Okay so this file is included wherever you want the breadcrumbs presumably? Looking at the code there's nothing I can see that would change the value, it must be happening within the file that includes it. Can you post the code of a page where this file is included, and the values are not correct?

Link to comment
Share on other sites

thanks mr adam..

 

but first of all i would try to check all the session conditions and setting of variables on the breadcrumbs page... there are couple of classes being embedded there..

 

i will get back here soon as long as i checked the page.

 

and once again thank you..

Link to comment
Share on other sites

hi mr adam.. i just found out that on the lower portion of the page... my co-worker added a session variables that sets everything session variables into blank each time it detects that the user didnot login. so that was the reason..

 

 

and also i found out how to make "breadcrumbs feature" using $_SERVER[HTTP_REFERER] and its was good.

 

thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.