LOGOUT - Reset Session

From: Date: Fri, 31 Jan 2003 07:50:14 +0000
Subject: LOGOUT - Reset Session
Groups: php.general 
Request: Send a blank email to php-general+get-133745@lists.php.net to get a copy of this message
Hello Everyone, I'm trying to create a Logout Function and Link. My site uses a standard htaccess file for its authentication method. After the brower requests the username and password they have access to the protected site. Then users can jump to a special Messaging section where I wrote a php script that retieves the $REMOTE_USER value and checks it against a message database. My problem is that I'd like to have a logout link that will dump the values the user had entered for their username and password so that they can no longer access the messages, neither with a back button nor just by going back to the site url. But since I am retrieving the $REMOTE_USER value using PHP4, it seems some how it remebers the username and password. Is that because I need to destroy the session and remove or replace the session cookies? I do not know what the session name is, nor how to check it. Here is what I have tried so far: function logout() { session_start(); session_destroy(); setcookie("SES_NAME","","","/"); header("Location: http://www.yahoo.com"); exit; } My results were that everytime I click the logout link, I can just press back on the browser and go back where I was and continue using the Messaging application. Thank you for any help you might provide... Larentium Larentium@hosthive.com

« previous php.general (#133745) next »