Forum Moderators: coopster

Message Too Old, No Replies

Multiple Sessions disrupting login script

         

ryan_b83

6:34 pm on Aug 21, 2006 (gmt 0)

10+ Year Member



Hello, ok i have a very odd problem and i can't seem to figure it out. Basiclly the problem is, i login and logout as different users, and sometimes (im not sure when exactly) but it switches to use a different session file. I used greenarray.php to display all the global variables i am using, and from one page to another i am using different session ID's. Even though my login page has what i beleive to kill the old session:

unset($_SESSION['user']);
session_unset();
session_destroy();

Shouldn't all those kill the session? But for some reason it will re-read the original session?

Thanks,
Ryan

ryan_b83

8:13 pm on Aug 21, 2006 (gmt 0)

10+ Year Member



Nevermind, i think i was not destroying the array correctly. This seems to work now...

$_SESSION = array();

if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}

session_destroy();