Page 1 of 1
HELP : Session value overwirting each another ?
Posted: Sat Mar 04, 2006 4:17 pm
by adisonz
when i browse the same page with different user id ,
the frist logged in user id will overlaped by the last loged in id ,
Code: Select all
$_SESSION['username'] = $_POST['username'];
this code will run when a sucessfull login ,
but when 2 successfull login will overwirte the frist value ,
plz help , any solution ?
Posted: Sat Mar 04, 2006 11:14 pm
by ambivalent
If you're doing this from the same browser and machine, the session id is still the same from PHP's point of view because the browser is sending the same cookie (assuming
default settings). It should work as expected if you
destroy the session of user 1. You may have to delete the session cookie as well, before attempting the second login.
Posted: Sun Mar 05, 2006 5:49 am
by Benjamin
You can use session_unregister() to unregister the variable on the logout page.
erm...yah ...i use session destroy ...but ..
Posted: Sun Mar 05, 2006 8:40 am
by adisonz
erm...yah ...i use session destroy ...but ..i need to demostrate to my tutor , that different user at one time ,
so i need to open 2 browser and both login ,
...any idea ?
Posted: Sun Mar 05, 2006 10:12 am
by feyd
yes, two different browsers.