Avoid PHP warning caused by session_regenerate_id()

Fixes #5268
This commit is contained in:
Frédéric Guillot 2023-05-26 17:58:10 -07:00 committed by Frédéric Guillot
parent 4121940ff1
commit cda45ddb30
1 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,8 @@ class UserSession extends Base
$user['twofactor_activated'] = isset($user['twofactor_activated']) ? (bool) $user['twofactor_activated'] : false; $user['twofactor_activated'] = isset($user['twofactor_activated']) ? (bool) $user['twofactor_activated'] : false;
if (session_status() === PHP_SESSION_ACTIVE) { if (session_status() === PHP_SESSION_ACTIVE) {
session_regenerate_id(true); // Note: Do not delete the old session to avoid possible race condition and a PHP warning.
session_regenerate_id(false);
} }
session_set('user', $user); session_set('user', $user);