]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't use empty session.cookie_path, otherwise we get multiple cookies
authorBart Visscher <bartv@thisnet.nl>
Thu, 18 Apr 2013 19:11:55 +0000 (21:11 +0200)
committerBart Visscher <bartv@thisnet.nl>
Thu, 18 Apr 2013 19:11:58 +0000 (21:11 +0200)
lib/base.php

index dde994a7e5775b7ee4f01249c5d59369afd40a14..50dd9a291239e0c87a6267d8b82a7a3636cf37d3 100644 (file)
@@ -324,7 +324,8 @@ class OC {
                ini_set('session.cookie_httponly', '1;');
 
                // set the cookie path to the ownCloud directory
-               ini_set('session.cookie_path', OC::$WEBROOT);
+               $cookie_path = OC::$WEBROOT ?: '/';
+               ini_set('session.cookie_path', $cookie_path);
 
                // set the session name to the instance id - which is unique
                session_name(OC_Util::getInstanceId());
@@ -357,7 +358,7 @@ class OC {
                // session timeout
                if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 60*60*24)) {
                        if (isset($_COOKIE[session_name()])) {
-                               setcookie(session_name(), '', time() - 42000, OC::$WEBROOT);
+                               setcookie(session_name(), '', time() - 42000, $cookie_path);
                        }
                        session_unset();
                        session_destroy();