#110908Backend re-login modal appears unreliably or far too late
Description
Problem
After the backend session expires, the re-login modal sometimes
appears and sometimes does not. In the second case the backend still
looks fine, but every AJAX action (page tree, context menu, drag and
drop, inline records, …) silently does nothing until the user
reloads the page.
Two causes:
- The session check runs on a fixed interval of
sessionTimeout - 60
seconds, counted from the moment the backend was loaded (since #76364,
2016). The session itself expiressessionTimeoutseconds after the
*last request*. So the first check only catches the “about to expire“
window if the user did nothing in the first 60 seconds after login.
Otherwise the session expires unnoticed, and the next check comes
another ~8 hours later (with the default timeout). - When the session is gone, the
BackendUserAuthenticatormiddleware
answers AJAX routes with a bare 401.AjaxRequestrejects the promise
and nothing in the backend reacts to it, so the user gets no hint.
Steps to reproduce
- Set
$GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'] = 300. - Log in to the backend and click around for two minutes.
- Wait five minutes without touching the backend.
- Right-click a page in the page tree: the context menu does not open, no modal is shown, no error is visible.
Expected
The “session about to expire” modal appears shortly before the session
expires, regardless of when the backend was loaded. If the session is
already gone, the first failed request opens the login form.
Fix
/ajax/login/timedoutadditionally returnsexpires_in(seconds
until the session expires). The client schedules the next check from
that value instead of polling on a fixed interval.AjaxRequestdispatchestypo3:ajax-request:unauthorizedon the
top frame for a 401 response. The login refresh module listens and
shows the login form at once.
Reviews 1
History 01
-
Gerrit Code Review pushed patch set 1 for main to change 96350 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-04T16:26:28+00:00" > 10/04/26, 16:26 </span>