RE: [PHP] Unsetting Session Variables
| From: | David Russell | Date: | Wed, 30 Oct 2002 15:30:19 +0000 |
| Subject: | RE: [PHP] Unsetting Session Variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122035@lists.php.net to get a copy of this message | ||
PHP 4.2.2
Register Globals Off
Using only $_SESSION
No session_register() calls at all
Interestingly enough, doing session_unregister('variablename') *in*
*addition* does work (although I am sure it shouldn't)
session_write_close() does not help
Any suggestions?
> -----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
Attachment: [application/x-pkcs7-signature] smime.p7s
Attachment: [application/x-pkcs7-signature] smime.p7s