RE: [PHP] logout

From: Date: Wed, 20 Jun 2001 17:47:12 +0000
Subject: RE: [PHP] logout
Groups: php.general 
Request: Send a blank email to php-general+get-54577@lists.php.net to get a copy of this message
This is how i did it. 1. Create a session variable after someone logs in properly (upon verification) // Set the session variable for clientId $session_clientId = $row['clientId']; 2. All the other pages wont allow you to view them unless the session var is set. and if you try to change the url parameter of another variable, you are denied too. session_register ("session_clientId"); if($session_clientId == ""){ die('Sorry, but you do not have permission to view this page - please <a href="client_login.php">login</a>');} if($clientId != $session_clientId){ die('Sorry, this is not one of your projects.<br> Please use the back button of your browser to return or <a href="client_login.php">login</a>');} //clientId was set from a previous query. 3. When you click on logout, you are sent back to the login page. 4. If the session was set, then session is destroyed. // Clears the user session for logging out. session_register ("session_clientId"); if ($session_clientId > 0 ){ session_destroy (); } 5. Voila.. when you use the back button, you are prevented from seeing the page. hth, q. -----Original Message----- From: Richard Heyes [mailto:richard.heyes@web-ideas.com] Sent: Wednesday, June 20, 2001 8:02 AM To: php-general@lists.php.net Subject: RE: [PHP] logout > Is there anyway I can do the logout that will completely get rid of all login > detail without having user to close browser?

« previous php.general (#54577) next »