From: Aaron Schulz Date: Sun, 28 Aug 2016 20:44:04 +0000 (-0700) Subject: Set the WRITE_SYNC flag for SessionBackend writes X-Git-Tag: 1.31.0-rc.0~5855^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=c5f92afc3be50dfe1463e61f704387f6e5e5b8e2;p=lhc%2Fweb%2Fwiklou.git Set the WRITE_SYNC flag for SessionBackend writes Session writes should be seen in all datacenters so users do not randomly end up logged on the next page view on a GET request after login. Sticky DC cookies help, but not for cross domain redirects or page views. Change-Id: Id533fa1b867680e6386060efa4878ad1b4638c18 --- diff --git a/includes/session/SessionBackend.php b/includes/session/SessionBackend.php index 264e1ae0ef..0439b36d48 100644 --- a/includes/session/SessionBackend.php +++ b/includes/session/SessionBackend.php @@ -716,6 +716,8 @@ final class SessionBackend { } } + $flags = $this->persist ? 0 : CachedBagOStuff::WRITE_CACHE_ONLY; + $flags |= CachedBagOStuff::WRITE_SYNC; // write to all datacenters $this->store->set( wfMemcKey( 'MWSession', (string)$this->id ), [ @@ -723,7 +725,7 @@ final class SessionBackend { 'metadata' => $metadata, ], $metadata['expires'], - $this->persist ? 0 : CachedBagOStuff::WRITE_CACHE_ONLY + $flags ); $this->metaDirty = false;