From 2af33d1ba0830953e089cf0caeaf778042531fb9 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Thu, 18 Oct 2001 10:11:06 +0000 Subject: [PATCH] There was a little bug in the destroy workaround (parameters switched) that caused to invalidate the first login on some browsers (at first I thought it was a browser issue). This problem shows out specially after a signout. This fix has been tested successfully with Konq, Mozilla, Galeon, Netscape 4 & 6, IE6 and Opera 5. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1582 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/login.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/login.php b/src/login.php index 4118d5c7..2b56300b 100644 --- a/src/login.php +++ b/src/login.php @@ -65,14 +65,16 @@ ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs); $base_uri = $regs[1]; - setcookie("username", '', 0, $base_uri); - setcookie("key", '', 0, $base_uri); - header ("Pragma: no-cache"); - - // In case the last session was not terminated properly, make sure - // we get a new one. - $cookie_params = session_get_cookie_params(); - setcookie(session_name(),"",0,$cookie_params["domain"].$cookie_params["path"]); + if ( session_id() <> '' ) { + session_destroy(); + // In case the last session was not terminated properly, make sure + // we get a new one. + $cookie_params = session_get_cookie_params(); + setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']); + } + setcookie('username', '', 0, $base_uri); + setcookie('key', '', 0, $base_uri); + header ('Pragma: no-cache'); do_hook('login_cookie'); @@ -84,8 +86,8 @@ if ($theme_css != "") echo "\n"; - echo ""; - echo $org_name . " - " . _("Login"); + echo '<TITLE>'; + echo $org_name . ' - ' . _("Login"); echo "\n"; echo "\n"; echo "
\n"; @@ -133,7 +135,7 @@ echo " \n"; echo " \n"; echo " \n"; - echo "
\n"; echo " \n"; @@ -142,7 +144,7 @@ echo "\n"; do_hook('login_form'); echo "
\n"; - do_hook("login_bottom"); + do_hook('login_bottom'); ?> -- 2.25.1