Session Management Review Prompt
Review the session lifecycle for the classic holes — fixation, weak expiry, missing rotation, insecure cookies, and sessions that outlive a logout or password change.
Overview
Sessions are where auth quietly breaks: a token that never expires, a session that survives a password reset, a cookie missing HttpOnly. This prompt reviews the session lifecycle end to end — creation, storage, expiry, rotation on privilege change, invalidation on logout and password change, and cookie security — against the well-known failure modes.
Why This Works
- The session lifecycle is where most real auth bugs live
- A checklist catches the invalidation-on-password-change gap teams routinely miss
- Cookie-flag and fixation checks are cheap to run and expensive to skip
Best for
- Any app with logged-in sessions
- Code after an auth change or library upgrade
- Apps handling sensitive accounts
Not for
- Choosing the auth mechanism — use the Authentication Strategy Prompt
- Reviewing JWT-specific issues — use the JWT Security Review Prompt
Use cases
- Reviewing session handling before a release
- Checking that sessions die on logout and password change
- Auditing cookie flags and session expiry