Auth0 Session Timeout Not Working for Next.js SPA
Sep 24, 2025
Overview
This article explains why the Auth0 session timeout does not work for Next.js Single Page Applications (SPA).
In the Tenant Settings > Advanced > Session Management, the following was configured:
- Enabled "Persistent Session";
- "inactivity timeout": 1 minute;
- "required login after": 1 minute.
However, after logging into the application and waiting for over 1 minute, the user is not logged out if the URL is refreshed.
Applies To
- Session Timeout
- Next.js SPA
Cause
Next.js SDK maintains its own session. More details can be found in this article: Sync session with Auth0 when using Next.js.
Solution