WCAG 2.2.6: Timeouts
Understanding WCAG 2.2.6: Timeouts
The WCAG 2.2.6 Timeouts success criterion, classified under Guideline 2.2: Enough Time, addresses a critical aspect of user experience and accessibility: session management. It mandates that if user inactivity on a web page or application could lead to data loss, users must be informed about the impending timeout and be given a reasonable opportunity to extend their session.
This criterion is crucial for maintaining user trust and preventing frustration, especially in scenarios where users are inputting significant amounts of data, completing complex forms, or engaging with systems that require focused attention over time.
Why WCAG 2.2.6 Timeouts Matters for Accessibility
Session timeouts, when not handled gracefully, can pose significant barriers for various user groups and negatively impact their ability to complete tasks effectively. Adhering to this criterion helps to:
WCAG 2.2.6 Success Criterion Explained
The core requirement of Success Criterion 2.2.6 is straightforward:
If a non-essential timeout occurs on the page, the user is warned and given at least 20 seconds to extend the timeout with a simple action (e.g. a single key press or tap).
Let’s break down the key components:
Exceptions to this Criterion:
There are specific scenarios where this criterion does not apply:
Practical Guidelines for Compliance
To implement WCAG 2.2.6 effectively, consider the following practical steps:
1. Identify Data-Loss Scenarios
2. Design a Clear and Accessible Warning Mechanism
3. Provide an Easy Option to Extend
4. Handle the Timeout Gracefully if Not Extended
Examples of Implementations
Correct Implementations
Example 1: Modal Dialog with Warning and Extend Button
A common and effective approach is to use a modal dialog that appears centrally, drawing immediate attention. The dialog provides a countdown and a clear button to extend the session.
HTML Structure:
CSS for Modal and Overlay:
JavaScript Logic:
Example 2: Top Banner Notification with Auto-Extend
A less intrusive, but still effective, method is a banner notification that appears at the top of the page. It can be combined with auto-extension on user activity for a smoother experience.
HTML Structure:
CSS for Banner:
JavaScript Logic (modified from previous):
Incorrect Implementations
Example 1: Abrupt Session Expiration Without Warning
The most common incorrect implementation is when a session simply expires, often redirecting the user to a login page, without any prior warning or opportunity to extend.
JavaScript (Simulated):
Why it's incorrect: The user receives no warning that their session is about to expire, leading to potential data loss and a frustrating user experience, especially for those who need more time.
Example 2: Warning Without an Option to Extend
Another incorrect approach is providing a warning, but not giving the user an option to extend the session, or making the extension process overly complicated.
HTML (Simulated):
JavaScript (Simulated):
Why it's incorrect: While a warning is present, the lack of a simple, direct way to extend the session violates the criterion's requirement to provide an "option to extend it with a simple action." Users are still forced to lose their progress and restart.
Best Practices and Common Pitfalls
Best Practices
Common Pitfalls
Conclusion
WCAG 2.2.6 Timeouts is a vital criterion for fostering an inclusive and user-friendly web. By thoughtfully implementing session timeout warnings and providing easy ways to extend sessions, you prevent data loss, reduce user frustration, and ensure that individuals with diverse needs have sufficient time to complete their tasks without unnecessary barriers. Adhering to this guideline is not just about compliance; it's about respecting your users' time and effort.
Related posts
- WCAG 5.2.3: Complete processes
- WCAG 5.2.4: Only Accessibility-Supported Ways of Using Technologies
- WCAG 5.2.5: Non-Interference
- WCAG 5.3.1: Required elements of the conformity declaration
- WCAG 5.3.2: Optional Components of a Conformance Claim
Still looking for answers?
Ask our experts using online chat