Skip to main content
Scope: the opt-in persistent sessions feature (auth.session.persistent), which sits next to cookie sessions.

Assets

Threats and mitigations

Residual risks

  • A token stolen and replayed within the grace window (30 seconds by default) gets the same successor.
  • The lost response rule allows one extra rotation from the previous token after the grace window when the successor was never used. A thief who replays it before the real client returns gets one session. The real client’s next refresh then trips reuse detection.
  • Revocations made outside theAuth, such as deleting session rows with SQL, do not end the device. Use theauth.persistentSessions.
  • Rows left from a period when the feature was turned off are not kept up to date. Empty the tables before turning it back on.
  • Cross-site scripting on your origin can call the refresh route from the victim’s browser, even though it cannot read the HttpOnly cookies.

Operating it

Keep the secret out of source control, never log cookie values, set trustedProxy correctly so rate limits and transport checks see real values, and alert on session.reuse_detected.
Last modified on December 3, 2026