On 27 January 2004 15:52, [EMAIL PROTECTED] wrote: > I am trying to find a reliable method to clean out all session > variables and start clean. > > Running PHP 4.3.1 on Win2K developing a web app to run on Linux. > Session cookies are enabled, register globals is off. I access all > session variables with $_SESSION. > > What I have found is that if I use unset($_SESSION), set a single > variable, and redirect, the OLD session data is passed to the > new page. > However if I use session_unset() or $_SESSION = array() and set my > single variable, the data is passed properly. > > Shouldn't unset($_SESSION) work?
No. The following Caution appears in the manual (at http://www.php.net/manual/en/ref.session.php#session.examples): Caution Do NOT unset the whole $_SESSION with unset($_SESSION) as this will disable the registering of session variables through the $_SESSION superglobal. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php