RE: [PHP] Using unset with $_SESSION
| From: | trlists at clayst dot com | Date: | Wed, 28 Jan 2004 13:33:02 +0000 |
| Subject: | RE: [PHP] Using unset with $_SESSION | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176036@lists.php.net to get a copy of this message | ||
> > 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.
Thanks -- I have to say I missed that one!
Thanks for noting session_write_close() as well. I did try that, but
it didn't seem to offer any advantages over letting the script write
the data on exit.
----------
Tom Rawson