cookie

A small named value a server asks a browser to store and send back automatically on later matching requests.

In more detail

The server creates one with Set-Cookie and the browser returns it in the Cookie header. A session cookie normally holds only a handle; the server looks it up to find the session. Attributes such as HttpOnly, Secure and SameSite limit where and when the browser sends it.

Example

In the browser: Cookies are how most sites remember that you are logged in. Because they travel with every request they cost bandwidth, and because they are sent automatically they enable cross-site request forgery unless protected with SameSite. Attributes such as HttpOnly and Secure limit who can read them.

Related terms

Taught in

References