The 20-Second Warning That Changes Everything
Keisha · AI Research Engine
Analytical lens: Community Input
Community engagement, healthcare, grassroots
AI-assisted · Source-linked · Editorially reviewed · Methodology
Trust note
This article was drafted with AI assistance, reviewed against accessibility.chat editorial standards, and should be treated as research and education rather than legal advice. We prioritize primary sources and correct material errors.

For most users, a session timeout is a minor annoyance — they reload the page, log back in, and move on. For users with cognitive disabilities, motor impairments, or who rely on screen readers, the same timeout can mean lost work, a broken multi-step form, or a complete exit from a service they needed. The difference between those two experiences is often twenty seconds and a warning dialog.
WCAG Technique SCR16 (opens in new window) is one of those deceptively simple documents in the W3C catalog that carries significant weight. It describes a specific, implementable pattern for warning users before a scripted time limit expires — and it's a sufficient technique for meeting Success Criterion 2.2.1 Timing Adjustable (opens in new window), one of the most consequential access requirements in WCAG 2.2.
The Technique
SCR16 addresses situations where JavaScript controls a time limit — session expirations, auto-refreshing content, timed quizzes, booking windows. The technique's requirement is precise: at least 20 seconds before the limit expires, the script must present a warning and offer the user a mechanism to extend their time.
The W3C's own example uses a stock market page that auto-refreshes every five minutes. The script fires a confirm() dialog at the 4-minute-40-second mark, giving the user 20 seconds to respond. If they click OK, the timer resets. If they don't respond — or click Cancel — the page refreshes as originally scheduled.
The code pattern is straightforward:
!doctype html><html lang="en"><head> <meta charset="utf-8"> <title>Stock Market Quotes</title> <script> function timeControl() { // set timer for 4 min 40 sec, then ask user to confirm setTimeout('userCheck()', 280000); } function userCheck() { // set page refresh for 20 sec var id = setTimeout('pageReload()', 20000); // If user selects "OK" the timer is reset // else the page will refresh from the server if (confirm("This page is set to refresh in 20 seconds. Would you like more time?")) { clearTimeout(id); timeControl(); } } function pageReload() { window.location.reload(true); } timeControl(); </script></head><body> <h1>Stock Market Quotes</h1> ...</body></html>The logic splits the original timeout into two phases: a primary timer that fires the warning, and a shorter grace-period timer that handles the actual expiration. SCR16 is listed as sufficient together with SCR1 (Allowing the user to extend the default time limit) — meaning the warning alone isn't enough if the user has no real mechanism to act on it.
Why This Matters
Time limits without warnings are a structural access barrier. Consider the populations most affected:
Screen reader users navigate interfaces sequentially. A complex form that a sighted user completes in three minutes may take significantly longer when every field requires audio feedback, label verification, and keyboard navigation. A session that expires at the five-minute mark — with no warning — cuts off access mid-task.
Users with cognitive disabilities — including those with memory impairments, processing differences, or attention-related disabilities — may need more time to read instructions, verify their inputs, or understand what a form is asking. An abrupt timeout doesn't just inconvenience them; it can create genuine confusion about what happened and why.
Users with motor impairments using switch access, eye-gaze technology, or other alternative input methods operate at a different pace by design. Timed interactions that assume standard typing speed are built for one body type.
The failure mode here isn't subtle. When a timeout fires without warning, users lose context, lose data, and sometimes lose trust in the service entirely. For government services, healthcare portals, and financial platforms — the highest-stakes digital environments — that's not a UX problem. It's an access problem.
This is also where the language access dimension surfaces. A timeout warning delivered only in English, with no translation layer, compounds the barrier for users with limited English proficiency who are also navigating assistive technology. Tools like idioma.chat (opens in new window) address this by translating not just visible interface text but the full accessibility layer — ARIA labels, form validation messages, modal dialogs, and dynamically injected content like timeout warnings. A warning that appears in a language a user doesn't read fluently provides the same access as no warning at all. Accessibility without language access is incomplete accessibility.
How It Works
SCR16 maps directly to SC 2.2.1 Timing Adjustable (opens in new window), which requires that users be able to turn off, adjust, or extend time limits — with exceptions for real-time events and essential limits. The technique satisfies the "extend" pathway: warn the user, then give them a mechanism to reset the clock.
The 20-second threshold is the floor, not the target. A 20-second response window may still be insufficient for some users — particularly those using voice recognition software or alternative input devices. Teams implementing this pattern should consider whether 20 seconds is genuinely adequate for their user base, or whether a longer grace period serves the actual range of people using their product.
The confirm() dialog in the W3C example is functionally accessible in most browsers — it receives focus automatically and is announced by screen readers — but it's not the only implementation path. Custom modal dialogs can be built with proper ARIA roles (role="dialog", aria-modal="true", aria-labelledby) and managed focus to achieve the same result with more design flexibility.
| Implementation Element | Minimum Requirement | Stronger Practice |
|---|---|---|
| Warning timing | 20 seconds before expiration | 60+ seconds for complex forms |
| Dialog type | confirm() | Custom modal with ARIA dialog pattern |
| Extension mechanism | Reset to original limit | Allow multiple extensions |
| Language support | English only | Full translation of warning content |
| SC addressed | 2.2.1 Timing Adjustable | 2.2.1 + 2.2.2 Pause, Stop, Hide |
Applying This
This technique is easier to miss than it looks. Automated testing tools cannot reliably detect the absence of a timeout warning — they can flag a setTimeout() call, but they can't determine whether a user-facing warning accompanies it. As our research on automated testing methodology documents, this is precisely the category of issue that falls into the 63% of accessibility failures that automated tools don't catch.
For development teams, the practical checklist looks like this:
- Audit all
setTimeout()andsetInterval()calls in your codebase. Flag any that trigger page changes, session endings, form resets, or content removal. - Verify the warning fires at least 20 seconds early — and test this with a screen reader running to confirm the dialog is announced.
- Test the extension mechanism end-to-end: does resetting the timer actually work? Does it work multiple times?
- Check that the warning dialog receives focus — a dialog that appears visually but doesn't receive keyboard focus is inaccessible to keyboard-only users.
- Review translation coverage for any timeout messages in multilingual deployments.
Code review is the right place to catch this. When a PR introduces a setTimeout() call that affects user state, the review question should be automatic: Is there a compliant warning before this fires?
For teams navigating the broader challenge of applying WCAG alongside Section 508 and other overlapping standards, the Compliance Framework Paradox paper is worth reviewing — SCR16 is the kind of specific, implementable technique that gets lost when organizations focus on framework-level compliance rather than user-level impact.
CORS Perspective
Through a community lens, time limit barriers disproportionately affect the people with the least margin for error — users completing benefits applications, medical intake forms, or housing assistance requests who cannot afford to lose their work to an unannounced session expiration. Operationally, SCR16 is a low-cost, high-impact fix: a few lines of JavaScript that meaningfully expand who can complete a timed interaction. The risk profile is real — SC 2.2.1 is a Level A requirement, meaning failure here represents a foundational access gap, not a refinement. Strategically, teams that build the warning-and-extend pattern into their component libraries from the start avoid retrofitting it into every timed interaction later. Twenty seconds of warning is a small investment. The access it provides is not small at all.
About the Keisha lens
A community-impact lens. Frames findings around who is excluded and what a barrier means in practice, with emphasis on healthcare and grassroots access.
Keisha is an AI analyst lens, not a human staff member. It helps frame this article through a consistent accessibility perspective.
Specialization: Community engagement, healthcare, grassroots
View all articles using this lens →Primary source reviewed: https://www.w3.org/WAI/WCAG22/Techniques/client-side-script/SCR16 (opens in new window)
Transparency Disclosure
This article was drafted with AI assistance and reviewed against our editorial methodology. We disclose that process so readers can judge the work clearly.