Skip to content

Commit

Permalink
[php:session] fix #3103 WARNING: setcookie(): Unrecognized key 'lifet…
Browse files Browse the repository at this point in the history
…ime'
  • Loading branch information
nao-pon committed Feb 1, 2020
1 parent 1570a9a commit bd98e9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions php/elFinderSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ public function close()
if (version_compare(PHP_VERSION, '7.3', '<')) {
setcookie(session_name(), session_id(), 0, $cParm['path'] . (!empty($cParm['SameSite'])? '; SameSite=' . $cParm['SameSite'] : ''), $cParm['domain'], $cParm['secure'], $cParm['httponly']);
} else {
$allows = array('expires' => true, 'path' => true, 'domain' => true, 'secure' => true, 'httponly' => true, 'samesite' => true);
foreach(array_keys($cParm) as $_k) {
if (!isset($allows[$_k])) {
unset($cParm[$_k]);
}
}
setcookie(session_name(), session_id(), $cParm);
}
$this->fixCookieRegist = false;
Expand Down

0 comments on commit bd98e9c

Please sign in to comment.