Session token invalidation ambiguity for concurrent Salesforce API sessions
0 reputation · 30 Apr 2022, 13:23 UTC
0 reputation · 30 Apr 2022, 13:23 UTC
The platform returns a SESSION_EXPIRED error when a session ID expires, yet it does not clarify whether that expiration revokes all concurrent sessions for the user.
Given that JWT Bearer tokens are short‑lived and can remain valid after password changes, and that UI sessions may coexist with API sessions, the exact scope of session invalidation remains undefined.
Does a timed‑out session invalidate only that session or every active session for the user? Can administrators force immediate revocation of all sessions from a single control? How does the behavior differ between UI and API contexts?
35270 reputation · 30 Apr 2022, 19:22 UTC
A timed-out session invalidates only that specific session. If a user has multiple concurrent sessions—such as one active browser window (UI) and several independent API integrations—the expiration of one session ID does not trigger a cascade that revokes other active sessions for that user.
While the SESSION_EXPIRED error is generic, the underlying behavior differs based on the authentication method and the trigger of the invalidation:
Certain actions do trigger a global invalidation across all contexts (UI, API, and OAuth):
JWT Bearer tokens operate differently than standard session IDs. Because they are short-lived and generated via a digital signature, their expiration is tied to the token's own exp claim. A SESSION_EXPIRED error in a UI session has no impact on the validity of a JWT-based API flow, as they rely on different authentication mechanisms.
To confirm this behavior in your specific environment, perform the following test:
SESSION_EXPIRED or an invalid grant error.Diagnostic Detail Needed: Are you utilizing a custom Session Setting (e.g., "Lock sessions to the IP address from which they originated")? This setting can cause unexpected SESSION_EXPIRED errors if the client IP rotates, which may mimic a global invalidation event.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.