· via dev.to (home feed)
Amazon Cognito adds per-device session listing and sign-out
Cognito user pools can now list every active sign-in and revoke sessions individually, replacing the old choice between global sign-out and hand-built refresh-token tables.

What changed
Since November 11, 2026, Amazon Cognito user pools support native session management: apps can enumerate every active sign-in for an account and end sessions one at a time, without the custom refresh-token bookkeeping this previously demanded.
According to a walkthrough on dev.to, the feature extends user pools — Cognito's user directory — with a server-side record for each sign-in. Once enabled for a pool, that record captures when the session began, when it was last active, the device type involved, and the originating IP address and city. New API operations expose the list and let callers terminate individual entries.
Previously Cognito offered RevokeToken, which only works while the application still holds the refresh token, and GlobalSignOut, which ends everything at once. Neither covered the everyday case of retiring one device — a lost tablet, say — whose tokens the app never sees. Teams wanting a "where am I signed in" screen had to maintain their own token table.
SSO sessions and token sessions
The dev.to post distinguishes two session kinds. An SSO session is created through Cognito's hosted managed login, lives in a browser cookie, and lets users reach other app clients in the same pool without re-entering credentials. A token session is created on each sign-in to an app client and follows the lifecycle of the refresh token that client received.
Refreshes extend an existing token session rather than spawning a new one; only a genuine fresh sign-in does that. Token sessions created through an SSO session record their parent in an OriginSessionId field, so one SSO session can carry several token sessions, while direct SDK sign-ins have no SSO parent.
With the feature enabled, Cognito also stamps a sid claim into ID and access tokens. Its value is stable across refreshes, making it usable in logs or custom checks. One warning from the article: a pre token generation trigger that sets its own sid claim effectively disables session management for the entire pool — Cognito leaves the custom claim untouched and the feature does not apply.
The new API surface
Four operations complement the existing ones. ListUserSessions and RevokeUserSession authenticate with the user's access token, which suits end-user "my devices" flows. AdminListUserSessions and AdminRevokeUserSession are IAM-authenticated backend calls intended for support teams investigating suspected misuse. GlobalSignOut and its admin variant remain available for emergencies.
Revocation accepts a RevokeAssociatedSessions parameter. The default, NONE, ends only the target session. LINKED also terminates connected sessions: ending an SSO session takes down the token sessions that grew from it, and ending a token session also ends its SSO parent, while sibling token sessions survive. The author recommends LINKED for device sign-out, because with NONE the browser cookie lets the device sign itself back in quietly.
Caveats for adopters
Session management must be switched on per user pool and requires the Essentials or Plus feature plan. The largest pitfall the article highlights: an access token already in circulation stays valid until it expires when an API validates tokens purely locally, so short access-token lifetimes matter — the example configuration sets 15 minutes. On the tooling side, the session commands ship in the AWS SDK for JavaScript v3 from version 3.1167.0; older builds simply lack them.
The walkthrough implements the pattern for a fictional bike rental service: an HTTP API with a JWT authorizer in front of three Lambda functions — one to list sessions, one to revoke, and one support-only function with no HTTP endpoint — all defined with the Serverless Framework in TypeScript.
Why it matters
Users increasingly expect a device list with per-device sign-out, whether they share an account, lose hardware, or suspect compromise. Meeting that expectation in Cognito used to mean bespoke revocation infrastructure and its attendant bugs. Native session listing and targeted revocation remove that burden, and give support staff a surgical instrument instead of the blunt global sign-out. The trade-offs are real — a paid feature plan, a need for short-lived access tokens, and the sid trigger conflict — but the change turns a persistent security gap into a matter of configuration.
- #aws
- #cognito
- #authentication
- #serverless
- #security