Session is getting overwritten in php using same browser.
Posted: Sun Jan 10, 2010 3:24 am
In having a problem of session overwriting using one browser.
Using PHP:
After a successful login I register the user session as below:
$_SESSION['username'] =$username;
I call this session from other pages for users ($_SESSION['username']) to get relevant data for the user.
It works fine when accessed with one user logged in. The problem starts when second user logs in.. Now, when I refresh the page of first user, second user data appears.. as session $SESSION[username] is overwritten by second logged in user.
This happens only when using same browsers for the users, this problem does not occur if both logged in different browsers. (Eg: if users both using firefox having problem, if one uses firefox and other uses Opera the problem does not occur.
Please.. Please give me some advice on this...
Using PHP:
After a successful login I register the user session as below:
$_SESSION['username'] =$username;
I call this session from other pages for users ($_SESSION['username']) to get relevant data for the user.
It works fine when accessed with one user logged in. The problem starts when second user logs in.. Now, when I refresh the page of first user, second user data appears.. as session $SESSION[username] is overwritten by second logged in user.
This happens only when using same browsers for the users, this problem does not occur if both logged in different browsers. (Eg: if users both using firefox having problem, if one uses firefox and other uses Opera the problem does not occur.
Please.. Please give me some advice on this...