Pick the fix
A first-party web app needs instant logout and admins must be able to kill a session. Best fit?
Hint 1 of 1
Where does revocation need to happen?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Server-side sessions with an HttpOnly, Secure, SameSite cookie
Correct. Revocation is deleting the session.
Revoking a session is just deleting a row on the server. A self-contained token stays valid until it expires unless you add a server-side check, which is the session model again.
Why not the others?
- B A 30-day JWT in localStorage. Readable by XSS and can't be revoked before expiry.
- C A 30-day JWT in a cookie. Still unrevocable without extra state.
- D Basic auth on every request. Sends the password every time.