Skip to content

Commit 5b64b81

Browse files
authored
Merge pull request #35866 from nextcloud/bugfix/noid/session-setup-followup
fix(session): Always setup the session if a session cookie is passed
2 parents 628b0d8 + 842f4d5 commit 5b64b81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
411411
public static function initSession(): void {
412412
$request = Server::get(IRequest::class);
413413
$isDavRequest = strpos($request->getRequestUri(), '/remote.php/dav') === 0 || strpos($request->getRequestUri(), '/remote.php/webdav') === 0;
414-
if ($request->getHeader('Authorization') !== '' && is_null($request->getCookie('cookie_test')) && $isDavRequest) {
414+
if ($request->getHeader('Authorization') !== '' && is_null($request->getCookie('cookie_test')) && $isDavRequest && !isset($_COOKIE['nc_session_id'])) {
415415
setcookie('cookie_test', 'test', time() + 3600);
416416
// Do not initialize the session if a request is authenticated directly
417417
// unless there is a session cookie already sent along

0 commit comments

Comments
 (0)