Expire Session
Command to mark a session as expired when its TTL has elapsed without activity.
Command
Description
This command transitions a session to the Expired state when its time-to-live has elapsed. Typically invoked by a background cleanup process or lazily when an expired session is accessed.
Preconditions
- Session exists and is in Active state
- Current time exceeds the session’s expiresAt timestamp
Command handler behavior
The Decider’s decide function validates:
- Session ID exists in current state
- Session is Active (not already Expired or Invalidated)
- Current time exceeds expiresAt
If validation passes, emits SessionExpired event. If session is already terminated, operation is idempotent.