Quiz Entry - updated: 2026.07.05
What are cookies and how do they work?
Cookies are key-value pairs the browser stores and automatically resends with every request to the same domain.
How they work:
- Server sets a cookie via
Set-Cookieheader in response - Browser stores the cookie
- Browser sends cookie with every subsequent request to that domain
- Server can read the cookie values
Cookies persist across requests and browser sessions (until they expire), enabling stateful behavior over stateless HTTP.
Go deeper:
Using HTTP cookies (MDN) — the canonical reference on Set-Cookie, the Cookie header, and lifetime/security attributes.
HTTP cookie (Wikipedia) — origin of the name, cookie types, and the privacy/security landscape.