Why this wireframe works | Session timeout warning modal
Warn before time runs out, and say what will happen
Some sites sign people out, or clear their answers, after a period of inactivity for security. Timing out without notice hurts most the people who have typed the most. Warning a little before the limit, such as “we will sign you out in 2 minutes”, and saying what will happen to their answers lets people choose to continue before anything is lost.
One button extends the time
A warning does not help if extending is hard to figure out. Pressing “Stay signed in” should extend the session and return people to their form, and that button should have focus when the warning opens. People get back to their task in one action, without thinking or searching.
It opens on a timer, not when someone presses something
Other modals normally open when the user presses a button. This one opens on its own after a set period of inactivity. Because it appears unexpectedly, the title states the situation briefly, such as “You are about to be signed out”, so it is clear at a glance why it opened.
Show the time left, but announce it only at intervals
The screen shows the time remaining as a number, counting down. Announcing it every second to a screen reader, however, makes everything else impossible to do. Reading the title and description when it opens, then announcing only at meaningful points such as one minute left, keeps people informed without getting in their way.
After a timeout, say what happened and what to do next
Dropping people back on a sign-in screen after a timeout leaves them unsure what happened. Say why, such as “For your security, we signed you out”, and state clearly whether their answers were saved. A “Sign in again” button lets them move on to the next step without hesitation.
Common mistakes | Session timeout warning modal
Signing people out with no warning
If people are signed out mid-form without notice, they only find out when they submit, and have to start again. Warn before the time runs out and let people extend it.
Announcing the time left every second
If the countdown is announced and updated every second, the screen reader keeps reading numbers and it becomes hard to reach the buttons. Keep the countdown itself out of announcements and limit how often you announce.
“Stay signed in” does not extend the server session
If only the on-screen timer restarts and the server session is not extended, people think they have continued but are signed out when they submit. When the button is pressed, tell the server to extend the session too.
Not saying what happened to their answers
“You have been signed out” alone leaves people unsure whether their answers are still there and whether to start again. Say whether answers were saved, and if not, that they need to start again.
Clicking the backdrop or pressing Esc signs people out
Someone who notices the warning and tries to dismiss it should not lose their answers. Do not close on a backdrop click, and treat Esc the same as “Stay signed in”. Sign out only when that button is chosen.
Treating Esc as a session extension
Extend the session only when the person chooses “Keep using”, after checking their authentication state. Even if Esc closes the dialog, closing alone must not extend the authentication period. After expiry, log out safely.
FAQ | Session timeout warning modal
How long before the timeout should the warning appear?
WCAG 2.2 Success Criterion 2.2.1 (Timing Adjustable) says that when you meet it by letting people extend the limit, you must warn them before time expires and give them at least 20 seconds to extend it with a simple action. Some government services time out after 15 minutes of inactivity and warn 2 minutes before. Allowing well over 20 seconds, for both reading and responding, is common.
Are modals not supposed to open only when someone presses something?
Yes, other modals normally open on a user action. A timeout warning is the exception: it opens on its own because otherwise people would lose their answers. For the same reason, use it only on screens that really have a time limit, and never reuse this behavior for notices or promotions.
Can we limit how many times people extend the time?
WCAG 2.2 Success Criterion 2.2.1 says that when you rely on extending, people must be able to extend at least ten times. If you set a limit for security, make it at least ten. Other options apply when people can turn the limit off or adjust it to at least ten times the default beforehand, or when the limit is longer than 20 hours.
Does this pattern work for forms without sign-in?
Yes. If you clear answers after a period of inactivity, warn in the same way even without sign-in. In that case say “We will delete your answers in 2 minutes” and let people choose between continuing and deleting their answers.













