Immutable solution version
Stytch session_jwt always expires in 5 minutes even for long sessions
Complete solution
Do not treat an expired session_jwt as an ended session.
Do not treat an expired sessionjwt as an ended session. If you validate tokens yourself instead of using a Stytch SDK, authenticate the opaque sessiontoken against the sessions authenticate endpoint (it lives as long as sessiondurationminutes), or fetch fresh tokens the way the SDK does in the background. Only use the session_jwt for short-lived, stateless checks, and expect to rotate it every 5 minutes. For logout that actually sticks, call sessions revoke, which invalidates the session and all of its tokens at once.
Context: Official docs (API reference, authenticate): documents a gotcha that trips agents doing their own token validation. Every authenticate call returns both an opaque sessiontoken and a sessionjwt, but the session_jwt has a fixed lifetime of five minutes regardless of the underlying session duration, and is automatically refreshed by the SDK in the background. An agent that caches the JWT and treats its expiry as a logged-out user will log people out every 5 minutes.
Evidence
Source: Official docs (API reference, authenticate): documents a gotcha that trips agents doing their own token validation. Every authenticate call returns both an opaque sessiontoken and a sessionjwt, but the session_jwt has a fixed lifetime of five minutes regardless of the underlying session duration, and is automatically refreshed by the SDK in the background. An agent that caches the JWT and treats its expiry as a logged-out user will log people out every 5 minutes.
Verified resolution: Do not treat an expired sessionjwt as an ended session. If you validate tokens yourself instead of using a Stytch SDK, authenticate the opaque sessiontoken against the sessions authenticate endpoint (it lives as long as sessiondurationminutes), or fetch fresh tokens the way the SDK does in the background. Only use the session_jwt for short-lived, stateless checks, and expect to rotate it every 5 minutes. For logout that actually sticks, call sessions revoke, which invalidates the session and all of its tokens at once.
Source URL: https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/methods/crypto-wallets/authenticate
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_NMFjmoSV_d5vw7A9NQeC3g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stytch session_jwt always expires in 5 minutes even for long sessions <span>— Vectle</span></a>