Silence duplicate session warnings

Fixes #20490

Basically restroring the old behavior.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-08-14 05:23:11 +02:00
parent 9bd58553db
commit 8daaf33e3d
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 4 additions and 4 deletions

View File

@ -104,7 +104,7 @@ class Internal extends Session {
public function clear() {
$this->invoke('session_unset');
$this->regenerateId();
$this->startSession();
$this->startSession(true);
$_SESSION = [];
}
@ -213,11 +213,11 @@ class Internal extends Session {
}
}
private function startSession() {
private function startSession(bool $silence = false) {
if (PHP_VERSION_ID < 70300) {
$this->invoke('session_start');
$this->invoke('session_start', [], $silence);
} else {
$this->invoke('session_start', [['cookie_samesite' => 'Lax']]);
$this->invoke('session_start', [['cookie_samesite' => 'Lax']], $silence);
}
}
}