[SOLVED] problem with session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
santo_hiu
Forum Newbie
Posts: 2
Joined: Thu Mar 24, 2005 12:54 pm

[SOLVED] problem with session

Post by santo_hiu »

hi all,
i have a form, on submit it takes an array of items id to be compared, then it goes to compare.php.
from there, the only link is to hit the go back button.
however if i do that, i lost my username session. well, not totally lost, but the username become truncated.
hence, i need to log out and re-login.
can anyone help?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

care to post your code? (make sure to read the posting code guidelines.)
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Sounds to me as if you have appended a new value on top of the existing session. Please post your code.
santo_hiu
Forum Newbie
Posts: 2
Joined: Thu Mar 24, 2005 12:54 pm

Post by santo_hiu »

yes indeed...

in the login page, i used --> $_SESSION['username']=$username;

then in the compare page, i redefined $username=$row['username'];
i think somehow, it conflicted.
I change the name in the compare page into $uname=$row['username'];

and it went perfectly fine now..
thanks for the help.
Post Reply