Re: SESSION values show up days later!

From: Date: Sat, 28 Mar 2009 04:27:20 +0000
Subject: Re: SESSION values show up days later!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-290782@lists.php.net to get a copy of this message
On Fri, Mar 27, 2009 at 02:39:22PM -0700, Mary Anderson wrote: > Hi all, > I use session variables to store values from one page to another on > my website. > Alas, sometimes, but not always, the values persist from one > invocation of the script to another! > Just how, exactly, do I make them go away when a user exits the > program? I assume my users will not always be logging out explicitly. > Thanks. > maryfran Unset the variable. Session variables (as far as I know) will persist as long as the user keeps open his browser, or until they time out. But you can do unset($_SESSION['myvar']) to unset a particular variable at any time (assuming you have previously called session_start()). Paul -- Paul M. Foster

« previous php.general (#290782) next »