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
This commit is contained in:
csteipp 2014-05-02 11:29:07 -07:00
parent 3ec32e3e5f
commit 1f7038363f

View file

@ -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();