Fix for bug number 110588. Addresses listed in the CC field of reply all messages...
[squirrelmail.git] / src / login.php
index c053f4803c021b2b215c26970e10aba1e16c7444..09e3d6f0a28d34171709ca0e7a68893953160211 100644 (file)
@@ -1,15 +1,15 @@
 <?php
    /**
-    **  login.php
+    **  login.php -- simple login screen
+    ** 
+    **  Copyright (c) 1999-2000 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
-    **  Very simple login screen that clears the cookie every time it's loaded
+    **  This a simple login screen. Some housekeeping is done to clean
+    **  cookies and find language.
     **
     **/
 
-   setcookie("username", "", time(), "/");
-   setcookie("key", "", time(), "/");
-   setcookie("logged_in", 0, time(), "/");
-
    if (!isset($config_php))
       include("../config/config.php");
    if (!isset($strings_php))
       }
    }
 
+   // Need the base URI to set the cookies. (Same code as in webmail.php)
+   ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
+   $base_uri = $regs[1];
+
+   setcookie("username", "", 0, $base_uri);
+   setcookie("key", "", 0, $base_uri);
+   setcookie("logged_in", 0, 0, $base_uri);
+
+   // In case the last session was not terminated properly, make sure
+   // we get a new one.
+   setcookie("PHPSESSID", "", 0, $base_uri);
+
    echo "<HTML>";
    echo "<HEAD><TITLE>";
    echo _("SquirrelMail Login");