← Back to topic library
Dev MaxxingIntermediateIdentity and Access60 sec
Cookie
A cookie is a small piece of data a server asks the browser to store, then automatically sends back with future requests to that same site.
Prerequisite: Session
What matters
Because cookies are sent automatically with matching requests, they're a common way to carry a session token, letting a server recognize the same user across page loads.
Example
A server might set a cookie containing a session token, which the browser then attaches to every following request to that site automatically.
Common misconception
A cookie does not require the user to manually resend it; the browser attaches matching cookies to requests automatically without any code needing to do so each time.
Recall question
What does the browser automatically do with a cookie set by a server?
Keywords and related concepts
cookiebrowser storagesession tokensession