• Success Criterion 2.2.1
  • Conformance level A

Re-Login Flow That Also Discards the User’s Entered Data

2.2.1 — Timing Adjustable

Scenario

Setting

A music streaming app's playlist screen

What’s wrong

Re-login loops that also discard entered data (compound with 2.2.5 AAA, but base timing fail here).

Example

// On session expiry:
window.location.href = "/login"; // newPlaylistName and selected tracks are discarded

Why it matters

A user naming a new playlist loses the name and track selections the moment they're forced to log back in.

How to test

Let a session time out mid-form: if re-login is required and the previously entered form data is also discarded, it fails.

How to fix

Persist in-progress work locally before forcing re-authentication.

function onSessionExpire() {
  localStorage.setItem('draftPlaylist', JSON.stringify(currentPlaylist));
  redirectToLogin();
}
// On successful login, restore from localStorage

Outcome

Logging back in, a user finds their half-built playlist exactly where they left it.

Who is affected

Users who take longer to complete tasks lose all their work every time the timeout forces a re-login.

Learn more