diff --git a/lib/base.php b/lib/base.php index 9956f0300a8..474209c1a1d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -387,17 +387,18 @@ class OC { // prevents javascript from accessing php session cookies ini_set('session.cookie_httponly', 'true'); - // Do not initialize sessions for 'status.php' requests - // Monitoring endpoints can quickly flood session handlers - // and 'status.php' doesn't require sessions anyway - if (str_ends_with($request->getScriptName(), '/status.php')) { - return; - } - // set the cookie path to the Nextcloud directory $cookie_path = OC::$WEBROOT ? : '/'; ini_set('session.cookie_path', $cookie_path); + // Do not initialize sessions for 'status.php' requests + // Monitoring endpoints can quickly flood session handlers + // and 'status.php' doesn't require sessions anyway + // We still need to run the ini_set above so that same-site cookies use the correct configuration. + if (str_ends_with($request->getScriptName(), '/status.php')) { + return; + } + // Let the session name be changed in the initSession Hook $sessionName = OC_Util::getInstanceId();