From 1f7038363f1a94433cda2aeb88ae7b54adcbcab4 Mon Sep 17 00:00:00 2001 From: csteipp Date: Fri, 2 May 2014 11:29:07 -0700 Subject: [PATCH] Maintain remember me state on password change Fix regression from https://gerrit.wikimedia.org/r/#/c/94614/ Ensure that when users login with "remember me" selected, they get a new remember me token after changing their password. Change-Id: Ibbf0d823bd5ef5304bf6ad1b67966d18dfb3580c --- includes/specials/SpecialChangePassword.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index 91d0404d8f..8afbf4b770 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -296,7 +296,8 @@ class SpecialChangePassword extends FormSpecialPage { if ( $isSelf ) { // This is needed to keep the user connected since // changing the password also modifies the user's token. - $user->setCookies(); + $remember = $this->getRequest()->getCookie( 'Token' ) !== null; + $user->setCookies( null, null, $remember ); } $user->resetPasswordExpiration(); $user->saveSettings(); -- 2.20.1