Merge "mw.page.gallery: Prevent jumpiness due to viewport height changes"
[lhc/web/wiklou.git] / includes / MediaWiki.php
index e6dc0fe..459a7e1 100644 (file)
@@ -636,9 +636,11 @@ class MediaWiki {
 
                if ( $cpIndex > 0 ) {
                        if ( $allowHeaders ) {
-                               $expires = time() + ChronologyProtector::POSITION_TTL;
+                               $now = time();
+                               $expires = $now + ChronologyProtector::POSITION_COOKIE_TTL;
                                $options = [ 'prefix' => '' ];
-                               $request->response()->setCookie( 'cpPosIndex', $cpIndex, $expires, $options );
+                               $value = LBFactory::makeCookieValueFromCPIndex( $cpIndex, $now ); // T190082
+                               $request->response()->setCookie( 'cpPosIndex', $value, $expires, $options );
                        }
 
                        if ( $strategy === 'cookie+url' ) {