summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/base.php3
-rw-r--r--lib/private/session/internal.php6
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');