Skip to content

Commit

Permalink
[php:session] fix Studio-42#3103 WARNING: setcookie(): Unrecognized k…
Browse files Browse the repository at this point in the history
…ey 'lifetime'

It is re-patch to fix Studio-42#3130. see Studio-42#3130.
  • Loading branch information
nao-pon committed Mar 16, 2020
1 parent 9ac3b5d commit 357bc43
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 @@ -231,6 +231,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 357bc43

Please sign in to comment.