aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-04-22 16:17:24 +0200
committerJulius Härtl <jus@bitgrid.net>2024-04-22 16:17:24 +0200
commit3377baa4391a2484d0b237caea2987f9ef5f2c53 (patch)
tree7194fd0e55be8b6a086cbb07ed848d463f6707a9
parentaff3e65806082e85765630dcdf292d54a7b40277 (diff)
downloadnextcloud-server-fix/lock-session-during-cookie-renew.tar.gz
nextcloud-server-fix/lock-session-during-cookie-renew.zip
fix: Lock session during renewal from cookiefix/lock-session-during-cookie-renew
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--lib/base.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 891161ff0c6..eeedea00372 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -1126,12 +1126,19 @@ class OC {
if ($userSession->tryTokenLogin($request)) {
return true;
}
+ $reopened = $userSession->getSession()->reopen();
if (isset($_COOKIE['nc_username'])
&& isset($_COOKIE['nc_token'])
&& isset($_COOKIE['nc_session_id'])
&& $userSession->loginWithCookie($_COOKIE['nc_username'], $_COOKIE['nc_token'], $_COOKIE['nc_session_id'])) {
+ if ($reopened) {
+ $userSession->getSession()->close();
+ }
return true;
}
+ if ($reopened) {
+ $userSession->getSession()->close();
+ }
if ($userSession->tryBasicAuthLogin($request, Server::get(IThrottler::class))) {
return true;
}