note 30689 added to function.session-destroy
| From: | neoh at bemusic dot be | Date: | Tue, 25 Mar 2003 21:05:36 +0000 |
| Subject: | note 30689 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45812@lists.php.net to get a copy of this message | ||
I don't know why, but I couldn't get that darn cookie to be killed and my session id kept
coming back. I tried all the suggestions above and NONE of them worked. (server: FreeBSD stable
running APACHE2) but finally, after 2 hours of trying and trying I got it. here is the code I use to
log a user out of his session and start a brand new one:
---------------------
session_unset();
setcookie (session_name(), '', (time () - 2592000), '/', '', 0);
session_destroy();
header("Location: ../index.php");
-----------------------
Yeah I know it is a pretty far in the past expiration date, but I was tired of testing and it works
great, god only knows why everything else don't work.
--
http://www.php.net/manual/en/function.session-destroy.php
http://master.php.net/manage/user-notes.php?action=edit+30689
http://master.php.net/manage/user-notes.php?action=delete+30689
http://master.php.net/manage/user-notes.php?action=reject+30689