Re: Re: PHP 4.0 Bug #3021 Updated: session_destroy does not work
| From: | Andrei Zmievski | Date: | Wed, 22 Dec 1999 14:52:57 +0000 |
| Subject: | Re: Re: PHP 4.0 Bug #3021 Updated: session_destroy does not work | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-13936@lists.php.net to get a copy of this message | ||
On Wed, 22 Dec 1999, Michael Bushey wrote:
> Not only does session_destroy not work, but if I use
> session_unset("varname"); the variable remains with the old value. The ONLY
> way I can clear out a session variable is to do a session_register and the
> set the variable to 0.
>
> example:
> page1:
> session_unset("IDmember");
>
> page2:
> session_register("IDmember");
> echo "IDmember: "$IDmember;
>
> page2 result:
> IDmember: 5
>
> If I were to change page 1 to
> session_register("IDmember");
> $IDmember=0;
> then I would get 0 out of the page2 result, which is effectivly cleared, but
> it bothers me that none of the session functions other than session_register
> work at all.
All the functions work properly, let's go through it step by step.
page1:
session_unset("IDmember");
Firstly, session_unset() does not take parameters, it simply clears all
the session variables. Secondly, I suspect what is happening here is
that your session is not started at all on page1 since you didn't call
session_start() or have session.auto_start = 1. Now, on page2, you have
session_register() which automatically starts the session and your value
for IDmember comes back and then saved back out to disk after script
finishes running.
-Andrei
* I don't mind going nowhere as long as it's an interesting path. *