Status: Accepted (2026-11-28). Extends 0302 (session-only routes) and 0011 (revocation). Contract: listSessions, revokeSession and revokeOtherSessions in shared/src/api.ts (additive).
A stolen session cookie could be ended only by the thief’s own logout. security.md’s threat model promised “sessions listed and revocable”, but the contract had no route. Sessions had no public id either: their primary key is the SHA-256 of the cookie token.
GET /v1/me/sessions: active sessions of the caller, newest activity first, at most 200. Fields: id, current, createdAt, lastSeenAt (written at most hourly), expiresAt, userAgent, ip (at sign-in). No token, hash or CSRF secret.DELETE /v1/me/sessions/:sessionId: deletes the session only if it is the caller’s; anything else is 404. Revoking the current session also clears its cookies.POST /v1/me/sessions/revoke-others: deletes every session of the caller except the current one and returns {revoked}.sessions.id uuid (migration 0004, gen_random_uuid()). It is not a secret and cannot be turned into the cookie. Lookups go through the existing sessions_user index and filter by id, so no new index is needed.linora_auth cred_revoked NOTIFY per session, with its credential id (s. + 12-byte hash prefix). Every API replica drops the cached session, and realtime closes sockets whose token carries that sid and refuses its tokens. This is the same as logout and PAT revoke.session.revoke (target = session id, detail.current) and session.revoke_others (detail.count), written in the same transaction (user-level: project_id NULL).user_sessions_revoked event kind: fewer NOTIFYs for revoke-others, but realtime would need a new event and a per-user sweep. Users have few sessions.apps/api/test/sessions.test.ts, pipeline.test.ts). tenancy.test.ts covers the new routes: 401 anonymous, 404 foreign, 403 PAT.