From: Gergő Tisza Date: Wed, 24 Feb 2016 06:45:04 +0000 (-0800) Subject: Do not vary on session cookies when the session is disabled X-Git-Tag: 1.31.0-rc.0~7826^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=20a247e40eeba4712f0b179b82e8e090d89a7090;p=lhc%2Fweb%2Fwiklou.git Do not vary on session cookies when the session is disabled MW_NO_SESSION is supposed to be used in a deterministic way (either always or never for a given endpoint) so there is no point to split the cache on session cookies when it is used (except when it's set to 'warn' in which case it is not really used). Bug: T127233 Change-Id: If44e0ec2167359e081e1b4cd4d21e62bd357d23e --- diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index 1aab12a895..b1d5d77e38 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -296,6 +296,9 @@ final class SessionManager implements SessionManagerInterface { } public function getVaryHeaders() { + if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) { + return []; + } if ( $this->varyHeaders === null ) { $headers = []; foreach ( $this->getProviders() as $provider ) { @@ -314,6 +317,9 @@ final class SessionManager implements SessionManagerInterface { } public function getVaryCookies() { + if ( defined( 'MW_NO_SESSION' ) && MW_NO_SESSION !== 'warn' ) { + return []; + } if ( $this->varyCookies === null ) { $cookies = []; foreach ( $this->getProviders() as $provider ) {