fix(session): refresh the 30s user-cache after a player's own changes (#239)

This commit is contained in:
Ferywir
2026-06-18 13:59:44 +02:00
committed by GitHub
parent cdc736839e
commit 1b978470c6
9 changed files with 45 additions and 0 deletions
+4
View File
@@ -22,6 +22,10 @@ AccessLogger::logRequest();
if(isset($_GET['ok'])){
$database->updateUserField($session->uid,'ok', 0, 1);
$_SESSION['ok'] = '0';
// Invalidate the 30s session user-cache (see Session::PopulateVar); otherwise
// it re-seeds $_SESSION['ok'] from the stale row and the welcome/maintenance
// redirect keeps firing for up to 30s after acknowledging.
unset($_SESSION['cache_user_' . ($_SESSION['username'] ?? '')]);
}
if(isset($_GET['newdid'])) {