Sessions need to die: explicitly (logout button), automatically (expiry), or en masse (Revoke All from the killswitch). Each path is one line of SQL plus a cookie clear.
Session sliding vs fixed expiry — pick one
| Pattern | Behavior | Pro | Con |
|---|---|---|---|
| Fixed (recommended) | Created at T, expires at T+30d, period | Predictable; easy to reason about | Active users get logged out at the wall |
| Sliding | Each request bumps expires_at to now+30d | Active users stay logged in | Inactive sessions linger if any request fires (e.g. a tab keeping a poller alive) |