signed cookie
A cookie whose value carries a signature, such as an HMAC, so the server can detect any change made by the client.
In more detail
The server recomputes the signature on each request and rejects the cookie if it does not match. Compare signatures in constant time, rotate the secret if it leaks, and encrypt as well if the contents must stay private.
Related terms
- HMAC — A way of combining a secret key with a hash function to produce a tag that shows a message came from someone holding the key and was not changed.
- session cookie — The cookie that proves a user is signed in, carrying a session ID or a signed or encrypted token.
- encryption — Scrambling data with a key so only someone holding the right key can read it.
Taught in
- Session Management: Secure Cookies & Token Validation — Next.js 15 & Modern App Router Architecture