Skip to content
Commitwise
Menu

Cookie

A small name-value pair a server stores in the browser with Set-Cookie, which the browser sends back on matching requests.

Definition

Attributes control it: Max-Age or Expires (lifetime), Domain and Path (where it is sent), Secure (HTTPS only), HttpOnly (hidden from JavaScript) and SameSite (Strict, Lax or None: whether cross-site requests carry it; Lax is the default). Session cookies should be Secure, HttpOnly and SameSite=Lax, ideally with the __Host- prefix.

In practice

Set-Cookie: __Host-session=8f2c91d4; Path=/; Secure; HttpOnly; SameSite=Lax

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.