From c1da4a95c341818ff229631e791f70e0d4dac04a Mon Sep 17 00:00:00 2001 From: Dillard Blom Date: Sun, 12 Jul 2026 14:14:27 +0200 Subject: [PATCH] Warn before the idle-timeout logs a user out mid-form Session timeout (30 min) only resets on a real PHP page load, but the Location QR type's address search runs entirely client-side against Nominatim, so a slow fill-in can silently expire the session and bounce the user back to login, losing the form. Adds a toast that appears a couple of minutes before expiry with a "stay logged in" button that pings session_ping.php to refresh last_activity without navigating away. --- src/includes/footer.php | 60 +++++++++++++++++++++++++++++++++++++++++ src/session_ping.php | 18 +++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 src/session_ping.php diff --git a/src/includes/footer.php b/src/includes/footer.php index b9c7be9..7a732d9 100644 --- a/src/includes/footer.php +++ b/src/includes/footer.php @@ -35,4 +35,64 @@ if ('serviceWorker' in navigator) { navigator.serviceWorker.register('service-worker.js'); } + + + + + \ No newline at end of file diff --git a/src/session_ping.php b/src/session_ping.php new file mode 100644 index 0000000..2a82254 --- /dev/null +++ b/src/session_ping.php @@ -0,0 +1,18 @@ + false]); + exit; +} + +echo json_encode(['ok' => true]);