mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #54776 from nextcloud/backport/54713/stable31
[stable31] fix(status.php): Fix samesite cookies
This commit is contained in:
commit
4948a742de
1 changed files with 8 additions and 7 deletions
15
lib/base.php
15
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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue