Only remove the "remember me" cookie at submitting the auth form

Fixes loss of remember (Friendica) cookie on switching Managed accounts
This commit is contained in:
Sandro Santilli 2017-03-13 11:57:10 +01:00
parent df6304cc42
commit cbaf196f50
2 changed files with 4 additions and 3 deletions

View File

@ -179,6 +179,10 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
goaway(z_root());
}
if ( ! $_POST['remember']) {
new_cookie(0); // 0 means delete on browser exit
}
// if we haven't failed up this point, log them in.
$_SESSION['remember'] = $_POST['remember'];
$_SESSION['last_login_date'] = datetime_convert('UTC','UTC');

View File

@ -141,9 +141,6 @@ function authenticate_success($user_record, $login_initial = false, $interactive
new_cookie(604800, $user_record);
unset($_SESSION['remember']);
}
else {
new_cookie(0); // 0 means delete on browser exit
}
}