summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-12-22 15:44:20 +0100
committerGitHub <noreply@github.com>2022-12-22 15:44:20 +0100
commit5b64b8119fc9c004887b514722bcecc2353564de (patch)
tree6aabbefdd1b8e4883396451038b172f162e24a6d
parent628b0d8fc43249e9116421133eda7ff6be72a706 (diff)
parent842f4d530fab291e8e6157689e53f405f044cad3 (diff)
downloadnextcloud-server-5b64b8119fc9c004887b514722bcecc2353564de.tar.gz
nextcloud-server-5b64b8119fc9c004887b514722bcecc2353564de.zip
Merge pull request #35866 from nextcloud/bugfix/noid/session-setup-followup
fix(session): Always setup the session if a session cookie is passed
-rw-r--r--lib/base.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index a7c36bcd3fe..6186e29bd6d 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -411,7 +411,7 @@ class OC {
public static function initSession(): void {
$request = Server::get(IRequest::class);
$isDavRequest = strpos($request->getRequestUri(), '/remote.php/dav') === 0 || strpos($request->getRequestUri(), '/remote.php/webdav') === 0;
- if ($request->getHeader('Authorization') !== '' && is_null($request->getCookie('cookie_test')) && $isDavRequest) {
+ if ($request->getHeader('Authorization') !== '' && is_null($request->getCookie('cookie_test')) && $isDavRequest && !isset($_COOKIE['nc_session_id'])) {
setcookie('cookie_test', 'test', time() + 3600);
// Do not initialize the session if a request is authenticated directly
// unless there is a session cookie already sent along