From 8daaf33e3d625a313c1560f07061bd3970dfd087 Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Fri, 14 Aug 2020 05:23:11 +0200
Subject: [PATCH] Silence duplicate session warnings

Fixes #20490

Basically restroring the old behavior.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 lib/private/Session/Internal.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php
index ffe16537874..f08f4da52a7 100644
--- a/lib/private/Session/Internal.php
+++ b/lib/private/Session/Internal.php
@@ -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);
 		}
 	}
 }
-- 
GitLab