Session Management
O.D.I.N. uses JWT-based sessions with server-side tracking, enabling you to view all active sessions and revoke them individually or all at once.
How Sessions Work
When you log in, O.D.I.N.:
- Creates a JWT with a unique
jti(JWT ID) claim - Stores the
jtiin theactive_sessionstable alongside your IP address, user agent, and timestamps - Sets the JWT as an httpOnly, Secure, SameSite=Strict cookie — the browser sends it automatically but JavaScript cannot read it (XSS-resistant)
Session expiry is 24 hours from creation. The active_sessions table records last_seen_at on each authenticated request.
The WebSocket endpoint (/ws) issues a short-lived token scoped exclusively to WebSocket connections. This token cannot be replayed against REST API endpoints. This prevents WebSocket token theft from granting access to the full API. (Introduced in v1.3.63)
Viewing Active Sessions
- Go to Settings → Account → Sessions
- The active sessions list shows:
- Device (user agent string, simplified)
- IP address
- Session created timestamp
- Last seen timestamp
Only your own sessions are visible by default. Admins can view and revoke sessions for any user under Settings → Access → Users → [User] → Sessions.
Revoking Sessions
Revoke a Single Session
Click Revoke next to any session entry. The jti is immediately added to the token_blacklist table. Any subsequent request with that token returns 401 Unauthorized.
Revoke All Sessions
Click Revoke All Sessions to invalidate every active session for your account. This is useful if you suspect your account is compromised.
Admins can revoke all sessions for any user.
Automatic Revocation Triggers
Some actions automatically revoke all existing sessions:
| Trigger | Behavior | Version |
|---|---|---|
| Password change | All sessions revoked; you must log in again | v1.3.66 |
| MFA token use | The MFA pending token is immediately blacklisted after use | v1.3.63 |
| Admin disables MFA | Existing sessions continue (only MFA config changes) | — |
| Account locked out | New logins blocked; existing sessions are not revoked automatically | — |
Token Blacklist Mechanics
The token_blacklist table stores revoked jti values with their expiry timestamps. On every authenticated request, O.D.I.N. checks if the token's jti is in the blacklist before allowing access.
The blacklist is pruned automatically of expired entries to prevent unbounded growth. Entries are kept until the original token's exp claim, after which they can be safely deleted (the token would be invalid by expiry anyway).
See Also
- MFA / Two-Factor Authentication — MFA setup and session interaction
- Users & Access Control — account roles and lockout behavior
- API Tokens — scoped API tokens as an alternative to session auth