note 31918 deleted from function.session-destroy by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 03:28:37 +0000 |
| Subject: | note 31918 deleted from function.session-destroy by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48379@lists.php.net to get a copy of this message | ||
Note Submitter: Yavuz
----
As explained above,
session_destroy() DOES return TRUE or FALSE.
If you want to make sure that the client is successfully logged out you can use this code below;
<?php
session_start();
//first initialize all variables
$_SESSION = array();
//then store the result of session destroy in a variable
$success = session_destroy();
if ($success) {
echo "You have been sucessfully Logged Out.";
}
else
{
echo "You could not be Logged Out.";
}
?>
This works with IIS & PHP4.3.1 & WinXP PRO.
You could replace echo statements with your own of course.
Yavuz