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:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 8:02 AM
To: [EMAIL PROTECTED]
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?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to