Make sure the session is updated after changing current profile
This commit is contained in:
parent
f64e74952b
commit
11c5c7a7b7
@ -32,6 +32,7 @@ Router\post_action('profile', function () {
|
||||
$new_password = empty($values['password']) ? null : $values['password'];
|
||||
if (Model\User\update_user($user_id, $values['username'], $new_password)) {
|
||||
SessionStorage::getInstance()->setFlashMessage(t('Your preferences are updated.'));
|
||||
SessionStorage::getInstance()->setUser(Model\User\get_user_by_id($user_id));
|
||||
} else {
|
||||
SessionStorage::getInstance()->setFlashErrorMessage(t('Unable to update your preferences.'));
|
||||
}
|
||||
|
@ -45,6 +45,19 @@ class SessionManager
|
||||
|
||||
public static function close()
|
||||
{
|
||||
$params = session_get_cookie_params();
|
||||
|
||||
setcookie(
|
||||
session_name(),
|
||||
'',
|
||||
time() - 42000,
|
||||
$params['path'],
|
||||
$params['domain'],
|
||||
$params['secure'],
|
||||
$params['httponly']
|
||||
);
|
||||
|
||||
session_unset();
|
||||
session_destroy();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user