RE: [PHP] Session_destroy problems...
| From: | Johnson, Kirk | Date: | Mon, 05 Nov 2001 17:29:01 +0000 |
| Subject: | RE: [PHP] Session_destroy problems... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73509@lists.php.net to get a copy of this message | ||
> I seem to have a problem with teh session_destroy function in that it
> appears not to work for me
>
> here is the code that is not working......
>
> if ($PHPSESSID) {
> session_start();
> session_destroy();
> }
> unset($PHPSESSID);
>
> ...................
>
> could anyone tell me why this does not get rid of the session
> marker on
> the browser.... as my "logout" function is failing and the
> above is all
> that is in the script !...
session_destroy() deletes the session data, wherever it is stored (by
default, in a file in /tmp). session_unset() clears the session data from
memory in the current script. By default, the session ID is passed between
the browser and server using a cookie named PHPSESSID. I am not sure if this
is what you are referring to as the "session marker on the browser". To
remove this cookie, I think you need to do a setcookie("PHPSESSID",0) or
something similar.
Kirk