note 19684 added to function.session-destroy
| From: | sergerivest at yahoo dot com | Date: | Thu, 07 Mar 2002 16:22:18 +0000 |
| Subject: | note 19684 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27480@lists.php.net to get a copy of this message | ||
Because session_destroy do not delete the session cookie and
setcookie(session_name(),"","","/") does not work fine for me,
i've used this code to create a new session at each time the user log into a different name :
// If a session already exist, destroy it
if(isset($_COOKIE[session_name()]))
{
session_start(); // To be able to use session_destroy
session_destroy(); // To delete the old session file
unset($_COOKIE[session_name()]);
}
// Start a brand new session for this user
session_start();
--
If you found a mistake please email me.
--
http://www.php.net/manual/en/function.session-destroy.php
http://master.php.net/manage/user-notes.php?action=edit+19684
http://master.php.net/manage/user-notes.php?action=delete+19684
http://master.php.net/manage/user-notes.php?action=reject+19684