Re: session_unset & session_destroy being called outside of logic.

From: Date: Thu, 13 Sep 2001 22:27:44 +0000
Subject: Re: session_unset & session_destroy being called outside of logic.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67277@lists.php.net to get a copy of this message
I think I found the answer, but please feel free to still add anything to this: session_destroy() terminates the session, which cannot be started up again until the browser is restarted... sooo... I just removed session_destroy, and settled for using sess_unset() to log out of a session. using this method the session is still open, and the session variables are still registered. since they are still registered, they can still be used on the chance that I log in again, correct? seems to be working fine, but if there are caveats, feel free to let me know. thanks! ----- Original Message ----- From: "Jason Bell" <jbell@barkingrat.com> To: "PHP Users" <php-general@lists.php.net> Sent: Thursday, September 13, 2001 3:12 PM Subject: [PHP] session_unset & session_destroy being called outside of logic. Hello all! I am switching a variable to check if a user is logging in or logging out. If the value of the variable is logout, I want the user to logout, i.e: case logout: session_unset(); session_destroy(); $AuthErr = "<FONT SIZE=-1 COLOR=red>Session Terminated</FONT>"; break; What is happening, is after the user authenticates and logs in, everything looks good, but whenever the user follows any link, the session gets unset and destroyed. I know that the variable that holds the logout value isn't even present, so I'm not sure how it's getting called... has anyone experienced this before? How did you get around it? Thanks! Jason

« previous php.general (#67277) next »