Session expiration bug fix

main
Yasen Pramatarov 2025-04-14 10:06:13 +03:00
parent 16854f0f77
commit 67ba6b38c7
1 changed files with 5 additions and 3 deletions

View File

@ -15,12 +15,14 @@ function applySessionMiddleware($config, $app_root, $isTest = false) {
// Check session validity
if (!Session::isValidSession()) {
// Only show session timeout message if there was an active session
if (isset($_SESSION['LAST_ACTIVITY'])) {
Feedback::flash('LOGIN', 'SESSION_TIMEOUT');
}
// Session invalid, clean up and redirect
Session::cleanup($config);
// Flash session timeout message
Feedback::flash('LOGIN', 'SESSION_TIMEOUT');
if (!$isTest) {
header('Location: ' . $app_root . '?page=login');
exit();