This will hopefully solve the src/src problem. I am a bit concerned about
[squirrelmail.git] / src / login.php
index fdcfc86f4333befa4f31e1ff752bf54a90f68940..57a47e93f3f225470d7fe66542a9af08d11a1120 100644 (file)
@@ -66,9 +66,10 @@ require_once('../functions/page_header.php');
  */
 set_up_language($squirrelmail_language, TRUE);
 
-/* Need the base URI to set the cookies. (Same code as in webmail.php). */
-ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
-$base_uri = $regs[1];
+/**
+ * Find out the base URI to set cookies.
+ */
+$base_uri = dirname(dirname($PHP_SELF));
 @session_destroy();
 
 /*
@@ -76,7 +77,8 @@ $base_uri = $regs[1];
  * we get a new one.
  */
 $cookie_params = session_get_cookie_params();
-setcookie(session_name(),'',0,$cookie_params['path'].$cookie_params['domain']);
+setcookie(session_name(), '', 0, $cookie_params['path'], 
+          $cookie_params['domain']);
 setcookie('username', '', 0, $base_uri);
 setcookie('key', '', 0, $base_uri);
 header('Pragma: no-cache');