Skip to content

Commit

Permalink
replace setcookie value with '' instead of null.
Browse files Browse the repository at this point in the history
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 <mart.b@outlook.de>
  • Loading branch information
MartB committed Sep 6, 2018
1 parent bf630e4 commit fe21b10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Session/Internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit fe21b10

Please sign in to comment.