From fbc1f5cd3813b5e0a6b8932f175c53da9692466a Mon Sep 17 00:00:00 2001 From: MartB Date: Thu, 6 Sep 2018 20:34:16 +0200 Subject: [PATCH] replace setcookie value with '' instead of null. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The php documentation states that an empty string should be used for a cookie when it has no real value. null leads to the following error: expects parameter 2 to be string, null given Signed-off-by: Martin Böh --- lib/base.php | 2 +- lib/private/Session/Internal.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/base.php b/lib/base.php index 628756cd217c7..23b9adde86a9b 100644 --- a/lib/base.php +++ b/lib/base.php @@ -441,7 +441,7 @@ public static function initSession() { // session timeout if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) { if (isset($_COOKIE[session_name()])) { - setcookie(session_name(), null, -1, self::$WEBROOT ? : '/'); + setcookie(session_name(), '', -1, self::$WEBROOT ? : '/'); } \OC::$server->getUserSession()->logout(); } diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index 182754f457cd2..6d09a2fab1b05 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -54,7 +54,7 @@ public function __construct(string $name) { try { $this->invoke('session_start'); } catch (\Exception $e) { - setcookie($this->invoke('session_name'), null, -1, \OC::$WEBROOT ?: '/'); + setcookie($this->invoke('session_name'), '', -1, \OC::$WEBROOT ?: '/'); } restore_error_handler(); if (!isset($_SESSION)) {