- Better session handling for the logout/wrong password case

SVN:code[21]
This commit is contained in:
Denis Flaven
2009-03-30 11:39:28 +00:00
parent 94d098c7e9
commit eb1dfe07e6

View File

@@ -90,6 +90,17 @@ h1 {
}
if (!UserRights::Login($sAuthUser, $sAuthPwd))
{
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()]))
{
setcookie(session_name(), '', time()-3600, '/');
}
// Finally, destroy the session.
session_destroy();
$oPage = new login_web_page();
$oPage->DisplayLoginForm( true /* failed attempt */);
$oPage->output();