summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-04-19 01:17:35 -0700
committerThomas Tanghus <thomas@tanghus.net>2013-04-19 01:17:35 -0700
commit4ccc9d896ab132eb98d3c8eb6e90daea556e3881 (patch)
tree05c2618bb00211935c451ec0bba73a4dd9b2c1ec /lib/base.php
parent1ad0c11136a5e1eefcc13a83c195ff206853ee16 (diff)
parente4876c91176473c19e8c24d8fcb6e338cffa0123 (diff)
downloadnextcloud-server-4ccc9d896ab132eb98d3c8eb6e90daea556e3881.tar.gz
nextcloud-server-4ccc9d896ab132eb98d3c8eb6e90daea556e3881.zip
Merge pull request #3010 from owncloud/fix-cookie_path
Don't use empty session.cookie_path, otherwise we get multiple cookies
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index cb2193bb7aa..7b0967df9f9 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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();