Fix password change in cookie auth

We can not set same cookie twice, so we have to avoid sending auth
cookie when we're about to change the password.

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-08-02 08:42:44 +02:00
parent cdcf74ab0b
commit 38b73180fd

View File

@ -492,7 +492,11 @@ class AuthenticationCookie extends AuthenticationPlugin
$this->storeUsernameCookie($cfg['Server']['user']);
// Duration = as configured
$this->storePasswordCookie($cfg['Server']['password']);
// Do not store password cookie on password change as we will
// set the cookie again after password has been changed
if (! isset($_POST['change_pw'])) {
$this->storePasswordCookie($cfg['Server']['password']);
}
// Set server cookies if required (once per session) and, in this case,
// force reload to ensure the client accepts cookies