Session guard refresh 1s

This commit is contained in:
2026-09-12 09:59:36 +02:00
parent fc1a211c73
commit 987bcf5684
4 changed files with 101 additions and 50 deletions
+16
View File
@@ -12,6 +12,18 @@ if (!has_admin_user()) {
exit;
}
// Als de sessie verlopen, ingetrokken of gewijzigd is: beëindig deze direct en wis cookies
if (isset($_GET['expired']) || isset($_GET['revoked']) || isset($_GET['ip_changed'])) {
if (!empty($_SESSION['user_id'])) {
fociz_terminate_session(session_id());
}
clear_day_session_cookie();
$_SESSION = [];
if (session_status() === PHP_SESSION_ACTIVE) {
@session_regenerate_id(true);
}
}
// Als al ingelogd (via actieve sessie of persistente cookie), ga direct naar planner
$currentUser = get_logged_in_user();
if ($currentUser) {
@@ -338,6 +350,10 @@ $pageTitle = "Fociz — Inloggen";
</div>
<script>
try {
localStorage.removeItem('fociz_session_last_activity');
localStorage.removeItem('fociz_session_logged_out');
} catch(e) {}
if (typeof lucide !== 'undefined') lucide.createIcons();
</script>
</body>