note 31918 added to function.session-destroy

From: Date: Thu, 08 May 2003 22:44:03 +0000
Subject: note 31918 added to function.session-destroy
Groups: php.notes 
Request: Send a blank email to php-notes+get-47715@lists.php.net to get a copy of this message
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 -- http://www.php.net/manual/en/function.session-destroy.php http://master.php.net/manage/user-notes.php?action=edit+31918 http://master.php.net/manage/user-notes.php?action=delete+31918 http://master.php.net/manage/user-notes.php?action=reject+31918

« previous php.notes (#47715) next »