fix(session): Always setup the session if a session cookie is passed

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/35866/head
Julius Härtl 2 years ago
parent 5c4b4bde1b
commit 842f4d530f
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
  1. 2
      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

Loading…
Cancel
Save