jenkins-bot has submitted this change and it was merged.

Change subject: Use $wgExtendedLoginCookieExpiration when setting login cookies
......................................................................


Use $wgExtendedLoginCookieExpiration when setting login cookies

Bug: 66699
Change-Id: Id043ee70d5b45cc71e23c24918acff0ff186b684
Depends-On: I0cc24524e4d7d9d1d21c9fa8a28c7c76b677b96c
---
M includes/CentralAuthUser.php
1 file changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 20c517c..c2490ac 100755
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2316,7 +2316,7 @@
         */
        static function setCookie( $name, $value, $exp = -1, $secure = null, 
$prefix = false ) {
                global $wgCentralAuthCookiePrefix, $wgCentralAuthCookieDomain,
-                       $wgCookieExpiration, $wgCentralAuthCookiePath;
+                       $wgCookieExpiration, $wgCentralAuthCookiePath, 
$wgExtendedLoginCookieExpiration;
 
                if ( CentralAuthHooks::hasApiToken() ) {
                        throw new Exception( "Cannot set cookies when API 
'centralauthtoken' parameter is given" );
@@ -2325,7 +2325,13 @@
                self::setP3P();
 
                if ( $exp == -1 ) {
-                       $exp = time() + $wgCookieExpiration;
+                       $exp = time();
+
+                       if ( $wgExtendedLoginCookieExpiration !== null ) {
+                               $exp += $wgExtendedLoginCookieExpiration;
+                       } else {
+                               $exp += $wgCookieExpiration;
+                       }
                } elseif ( $exp == 0 ) {
                        // Session cookie
                        $exp = null;

-- 
To view, visit https://gerrit.wikimedia.org/r/141394
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id043ee70d5b45cc71e23c24918acff0ff186b684
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
Gerrit-Reviewer: Aklapper <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to