Page 2 of 2

Posted: Fri Dec 15, 2006 10:09 am
by RobertGonzalez
The sign out (or logout) routine typically involves click origination. What that means is that a user clicks a link/button and then is taken to a page that handles logouts and session destruction. Closing a session should not happen automatically unless your allowable logged in time limit is reached.

Posted: Fri Dec 15, 2006 10:42 am
by boo_lolly
write a redirect page. when the user clicks <span><a href="redirect.php">Sign Out</a></span>

the redirect page will look something like...

Code: Select all

<?php
//redirect.php

     signOut();
     header("Location: http://www.yoursite.com/youareloggedout.php");

?>

Posted: Fri Dec 15, 2006 11:56 am
by RobertGonzalez
So that would be two redirects?

Why not post back to the calling page with a querystring trigger?

Code: Select all

<?php
if (isset($_GET['logout']) && $_GET['logout'] == 'true')
{
    session_destroy();
    // Do whatever else you want to do on a logout
}

echo '<a href="' . basename($_SERVER['SCRIPT_FILENAME']) . '" title="Logout">Click here to logout</a>';
?>