By NHI Mgmt Group Editorial TeamBased on WorkOS: “How to revoke sessions and sign users out everywhere with the WorkOS Sessions API” (August 12, 2025)

TL;DR: Long-lived sessions can remain valid for weeks or months after password resets, device loss, or employee offboarding, according to WorkOS, which is why the ability to list and revoke active sessions is now a core SaaS security control. Session management is no longer just UX plumbing; it is the control that determines how quickly identity risk can be contained.


At a glance

What this is: WorkOS describes how its Sessions API lets applications list and revoke active sessions so teams can build sign-out-everywhere flows and shorten the window in which stolen or stale sessions remain usable.

Why it matters: For IAM and SaaS security teams, session revocation determines whether password resets, device loss response, and offboarding actually terminate access or merely change the login state while active sessions remain live.

By the numbers:

  • 64% of valid secrets leaked in 2022 are still valid and exploitable today, proving that detection alone is not enough without automated revocation, according to the State of Secrets Sprawl 2026.

Context

Session revocation is the ability to terminate active authenticated sessions before their natural expiry. In SaaS applications, that control matters because a password reset or account change does not automatically invalidate every existing device session unless the product explicitly enforces it.

The governance gap is straightforward: authentication often gets attention at login, while session lifecycle is treated as secondary plumbing. That leaves a window where a user can be offboarded, a device can be lost, or credentials can be exposed, yet access continues through already-issued sessions.

For IAM teams, the question is not whether users should be able to stay signed in across devices. It is whether the platform can enumerate those sessions, revoke them selectively, and prove that access truly ended when the security event occurred.


Key questions

Q: What breaks when session revocation is missing from identity controls?

A: Without revocation, a valid session can continue to authenticate after the user resets a password, loses a device, or leaves the organisation. That means access outlives the event that should have ended it, especially when the same identity is active across multiple devices or delegated AI agent sessions. The failure is not expiration, it is residual trust.

Q: Why do long-lived sessions increase identity risk after a password change or offboarding event?

A: Because a password change only protects future authentication unless the application also kills existing sessions. An attacker, former employee, or user on a stolen device can continue operating under the old session if it stays valid. That creates a gap between identity change and access termination that many SaaS platforms still leave open.

Q: How can organisations tell whether session revocation is actually working?

A: Look for rejected reuse attempts on revoked session IDs, complete revocation coverage after lifecycle events, and audit logs that show who revoked what and when. If users can keep acting with old sessions, or if revocation is invisible in logs, the control is not working as intended.

Q: What should organisations do when users sign in from multiple devices?

A: They should assume every device creates a separate active session and design controls that can list, revoke, and audit each one independently. That makes it possible to support enterprise features such as sign out everywhere without leaving hidden sessions behind on unmanaged devices or shared endpoints.


Technical breakdown

How session listing exposes the true access surface

Modern SaaS commonly issues one session per device or browser, each with its own token, expiry, and metadata such as IP address and user agent. A session inventory therefore becomes the practical view of who is actually authenticated, not just who last completed login. Without that inventory, security teams are blind to parallel sessions created before a password change, MFA reset, or offboarding event. Listing sessions is the prerequisite for any meaningful revocation workflow because you cannot terminate what you cannot enumerate.

Practical implication: build session visibility before relying on password resets as a containment control.

Why revocation is different from logout

Logout usually clears the local browser state on one device, while revocation invalidates the server-side session so it can no longer be accepted elsewhere. That distinction matters because stolen cookies or long-lived session tokens can remain usable until expiry unless the backend refuses them. A proper sign-out-everywhere flow therefore combines server-side revocation, local token clearing on the initiating device, and graceful rejection handling when other devices next call the API. The control point is the session record, not the browser UI.

Practical implication: treat server-side revocation as the real control and logout as only one part of the user experience.

Why session metadata improves selective containment

Session metadata such as IP address, device information, and last active time lets teams distinguish normal usage from suspicious access patterns. That supports selective revocation, such as ending only a risky session when logins appear from distant geographies within minutes, instead of forcing a full account lockout. In practice, this is a containment pattern for SaaS identity security: narrow the blast radius while preserving legitimate access where possible. The stronger the metadata and event handling, the faster you can separate benign from malicious sessions.

Practical implication: feed session metadata into revocation decisions so containment can be targeted instead of all-or-nothing.


Threat narrative

Attacker objective: Maintain authorized-looking access after the user or administrator believes the account has been secured, allowing continued use of the SaaS identity.

  1. Entry occurs when a password is reset, a device is lost, or credentials are exposed, but pre-existing sessions are still accepted by the application.
  2. Credential use continues through long-lived session tokens or cookies that remain valid on other devices after the initiating event.
  3. Escalation happens when the attacker or unauthorized user keeps using the still-active session to operate under the legitimate account identity.
  4. Impact is sustained access across devices and applications until the server-side session is explicitly revoked or expires.
  • Nx s1ngularity attack 2025: Attackers stole Nx's npm token via a GitHub Actions flaw and shipped malware that stole 2,349 secrets and abused developers' AI CLIs.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Session revocation is the control boundary that turns authentication into containment: password resets, device loss response, and offboarding only reduce risk if the backend can invalidate active sessions immediately. In SaaS, access is often distributed across multiple devices and browser contexts, so the real security question is whether the platform can end those sessions centrally. Practitioners should treat revocation as a first-class identity control, not a convenience feature.

Long-lived session debt is the hidden exposure window in modern SaaS: every active token that outlives the event that should have ended it becomes deferred identity risk. That risk is especially acute when organisations assume that login controls and session controls are interchangeable, because they are not. The governance lesson is that session lifetime must be governed as aggressively as credential lifetime.

Sign-out-everywhere is a governance pattern, not just a user feature: when users can see and revoke their own sessions, they gain a direct response path for account compromise and shared-device hygiene. When operations teams can revoke sessions on offboarding, they close the gap between HR events and access termination. The practical conclusion is that session governance has to span user action, help desk action, and administrative action.

Session metadata creates the basis for targeted containment: IP address, user agent, and last-active time are not merely diagnostic fields, they are revocation signals. Without them, teams are pushed toward blanket account lockouts that are slower and more disruptive than necessary. The identity programme should therefore align session telemetry with response playbooks so containment can be selective and auditable.

Identity security now depends on issue-time and revoke-time controls working together: revocation closes the window after access has been issued, while stricter session handling limits how long that access can survive. This is where SaaS identity governance meets operational reality. Practitioners should make revocation evidence part of access assurance, because an unrevoked session is still active access.

From our research library:

What this signals

Session revocation is now part of identity containment, not just user convenience: SaaS teams that rely on logout alone are leaving a backend access path intact. The operational shift is to treat every active session as a governable object with its own lifecycle, because that is what determines whether risk actually ends.

Access review processes assume access persists long enough to be reviewed; session-based risk often does not: if a session can survive a password reset or offboarding event, the programme has a containment gap, not a visibility gap. Teams should therefore align revocation evidence with identity events, especially where shared devices and remote work create more concurrent sessions.

Session telemetry is the new decision surface for selective revocation: IP address, device, and last active time let teams preserve legitimate access while cutting off suspicious sessions. That makes session management a governance control with response implications, not merely an authentication feature.


For practitioners

  • Implement server-side session revocation Make session invalidation authoritative on the backend so stolen cookies and old devices stop working even if local browser state persists.
  • Build sign-out-everywhere flows List active sessions for the user, revoke each session by ID, and clear the initiating device locally so the action actually ends access everywhere.
  • Revoke all sessions after password resets Tie password change workflows to automatic revocation so a reset does not leave pre-existing sessions alive on laptops, phones, or shared devices.
  • Use session metadata for selective containment Combine IP address, user agent, and last active time to revoke only the suspicious session when the pattern looks abnormal, instead of locking the account globally.
  • Treat offboarding as session termination When a user leaves or loses access rights, revoke active sessions directly rather than waiting for expiry so access ends on the same governance event.

Key takeaways

  • SaaS session management is a containment control because active sessions can outlive password resets, device loss events, and offboarding.
  • The practical risk is not theoretical: sessions that remain valid after identity changes allow continued account use until the backend revokes them or they expire.
  • The decisive control is centralised session revocation backed by session inventory, telemetry, and workflows that terminate access across every device.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP API Security Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-01 — Improper OffboardingActive sessions outliving offboarding is the core failure pattern in this article.
NHI-07 — Long-Lived SecretsLong-lived session tokens create the same persistence problem as other long-lived secrets.
Recommendation — Revoke active sessions when users leave so access does not survive the offboarding event. Shorten session lifetime and enforce revocation so stale access cannot persist for weeks or months.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementSession token and authenticator lifecycle are central to the revocation workflow discussed here.
Recommendation — Apply authenticator management controls to invalidate sessions when credentials change or access is removed.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsRevoking sessions is part of ensuring access permissions are removed when they should no longer apply.
Recommendation — Use access permission governance to confirm that terminated users no longer retain active session authorisations.
OWASP API Security Top 10API2 — Broken AuthenticationRevoked sessions must no longer authenticate API requests, or the control fails in practice.
Recommendation — Validate that revoked sessions are rejected across all API authentication paths.

Key terms

  • Session revocation: The ability to invalidate active sessions so access ends immediately instead of waiting for tokens or browser state to expire. For identity governance, this is the control that determines whether authentication still matters after a compromise is detected.
  • Sign out everywhere: Sign out everywhere is a coordinated session termination pattern that revokes all active sessions for a user and clears the initiating device’s local state. It is not just logout. It is a containment workflow that assumes the account may already be exposed on multiple devices.
  • Session Metadata: Session metadata is the contextual information generated while access is being established or maintained, such as user identifiers, device posture, timestamps, and routing details. It can be regulated data under privacy law when it relates to an identifiable person or reveals their behaviour.
  • Long-Lived Session Token: A long-lived session token is an authenticator that remains usable for an extended period unless it is explicitly revoked or expires naturally. In identity programmes, these tokens increase exposure because a compromise can survive password resets or offboarding if session invalidation is missing.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are responsible for identity security strategy or NHI governance in your organisation, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 8, 2026.
Updated on October 7, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org