diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-20 13:47:46 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-20 13:47:46 +0300 |
commit | 64dc222ce58524225f164caf3f48b5c1ef39f025 (patch) | |
tree | 2a6a7d43e4618b81245427f1f0fc0b2225064e6c /lib | |
parent | adfb33b791ab0f57f0e195362cbe2a9a45de0f78 (diff) | |
parent | 5588c5f262b37ebb736c9cada0dc2a0fe2a70f7c (diff) |
Merge pull request #19874 from owncloud/delete-cookie-instead-of-setting-value-to-empty
Delete cookie instead of emptying value
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/private/session/internal.php | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php index 5deba7866f3..09e1d0aea49 100644 --- a/lib/base.php +++ b/lib/base.php @@ -427,7 +427,8 @@ class OC { // session timeout if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) { if (isset($_COOKIE[session_name()])) { - setcookie(session_name(), '', time() - 42000, $cookie_path); + setcookie(session_name(), null, -1, self::$WEBROOT ? : '/'); + unset($_COOKIE[session_name()]); } session_unset(); session_destroy(); diff --git a/lib/private/session/internal.php b/lib/private/session/internal.php index 01d4569fd81..0b6152acf12 100644 --- a/lib/private/session/internal.php +++ b/lib/private/session/internal.php @@ -41,7 +41,11 @@ class Internal extends Session { public function __construct($name) { session_name($name); set_error_handler(array($this, 'trapError')); - session_start(); + try { + session_start(); + } catch (\Exception $e) { + setcookie(session_name(), null, -1, \OC::$WEBROOT ? : '/'); + } restore_error_handler(); if (!isset($_SESSION)) { throw new \Exception('Failed to start session'); |