diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-08-16 10:09:14 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-08-17 12:10:27 +0200 |
commit | 9e1d4312555ddc1009450b1f6b7078ae35790593 (patch) | |
tree | d82dd6d0742db12cdd491b887ed573fb7f75ff3f /lib/private/Session/Internal.php | |
parent | 9b4b72826ade5ab1bc7fb06048e62910ef607cd8 (diff) | |
download | nextcloud-server-9e1d4312555ddc1009450b1f6b7078ae35790593.tar.gz nextcloud-server-9e1d4312555ddc1009450b1f6b7078ae35790593.zip |
Add config option to disable strict session timeout to be able to use read_and_close
Fixed https://github.com/nextcloud/server/issues/29356
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Session/Internal.php')
-rw-r--r-- | lib/private/Session/Internal.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index f192b20cc95..87dd5ed6014 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -178,7 +178,7 @@ class Internal extends Session { */ public function reopen(): bool { if ($this->sessionClosed) { - $this->startSession(); + $this->startSession(false, false); $this->sessionClosed = false; return true; } @@ -225,7 +225,11 @@ class Internal extends Session { } } - private function startSession(bool $silence = false) { - $this->invoke('session_start', [['cookie_samesite' => 'Lax']], $silence); + private function startSession(bool $silence = false, bool $readAndClose = true) { + $sessionParams = ['cookie_samesite' => 'Lax']; + if (\OC::hasSessionRelaxedExpiry()) { + $sessionParams['read_and_close'] = $readAndClose; + } + $this->invoke('session_start', [$sessionParams], $silence); } } |