Skip to content

Commit

Permalink
Merge pull request #35866 from nextcloud/bugfix/noid/session-setup-fo…
Browse files Browse the repository at this point in the history
…llowup

fix(session): Always setup the session if a session cookie is passed
  • Loading branch information
juliusknorr authored Dec 22, 2022
2 parents 628b0d8 + 842f4d5 commit 5b64b81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
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
Expand Down

0 comments on commit 5b64b81

Please sign in to comment.