RE: [PHP] Unsetting Session Variables
| From: | Ford, Mike [LSS] | Date: | Wed, 30 Oct 2002 15:07:55 +0000 |
| Subject: | RE: [PHP] Unsetting Session Variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122027@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: David Russell [mailto:DavidR@BarloworldOptimus.com]
> Sent: 30 October 2002 14:32
>
> I am having problems unsetting Session Variables - where I know it
> should work.
>
> I have a form. It contains both links with GET variables, and also a
> POST form. They all go to the same next page.
>
> Page 2 simply clears all session variables, and then sets them based
> upon the contents of the GET or POST array. It then calls page 3 which
> displays information based on the SESSION variable contents.
>
> My problem is that a session variable does not seem to unset. I am
> using:
>
> unset ($_SESSION['variablename']);
>
> But this does not seem to destroy the session variable. (it is still
> available later in other scripts)
>
> What can I do?
PHP version? register_globals on or off? Using only $_SESSION, or are
there any session_register() calls?
All of these can affect what you have to do to destroy session values,
but...
Have you tried doing session_unregister('variablename') *in* *addition*?
Does session_write_close() help?
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: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211