Code Review Prompt — the Review Contract
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Review the session lifecycle for the classic holes — fixation, weak expiry, missing rotation, insecure cookies, and sessions that outlive a logout or password change.
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.
Gather the session lifecycle code
Collect the code that creates, stores, expires, and invalidates sessions, plus the cookie settings. The review walks the lifecycle end to end.
Open this resource in Code Review Prompt Generator
Load the prompt into Code Review Prompt Generator and paste in the session code. It reviews for fixation, weak expiry, missing rotation, and insecure cookies.
Review the session findings
Read each finding - a session that outlives a logout or password change, a token that never expires, a cookie missing HttpOnly - against the known failure modes.
Fix the holes and re-review
Close the flagged issues, especially rotation on privilege change and invalidation on logout, then re-run the review to confirm the lifecycle is tight.
The SEVERITY section tags each finding [CRITICAL], [MAJOR], or [MINOR], and states that sessions surviving a password reset, or fixation, are CRITICAL. Code Review Prompt Generator produces this review prompt; you run it in your own assistant. Treat the output as a review to verify, not a security audit or a guarantee that every session hole was caught.
Seven, walked in order: FIXATION (fresh ID on login), EXPIRY (absolute and idle timeout), ROTATION on privilege change, INVALIDATION on logout and password change, STORAGE safety, COOKIE FLAGS, and CONCURRENCY including log out everywhere. It reviews the lifecycle code you paste and returns findings with locations; confirming and fixing them stays your responsibility.
Use a JWT-specific review for token-signature and claims issues; the notFor sends you to the JWT Security Review Prompt for those. This one targets the server-side session lifecycle instead, checking INVALIDATION on logout and where STORAGE lives. Choosing the auth mechanism is also out of scope, and the output is a review recommendation, not a validated sign-off.
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
Twelve security checks — injection, auth, secrets, SSRF, privilege escalation — reviewed the way an attacker would read the code.
Architecture review for the public surface: abstractions that earn their place, dependency direction, seams, and the patterns the codebase already has.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
A side-by-side way to decide between two ChatGPT prompt drafts — scored on clarity, specificity, output control, and risk instead of gut feeling.
Generate code review prompts for any scope — snippet, file, diff, or full pull request — with focused review rules.
Four hundred lines of login code and a yes-or-no. You can read every line, find nothing, and still be wrong — because what will hurt you is in the file nobody opened alongside it: a session that outlives a logout, a reset that leaves the old one working.