How HTTP Works

Reference

Cookie Attributes

Start here when a cookie behaves differently than you expected across environments, subdomains, or cross-site requests.

What Cookie Attributes Control

Most cookie bugs are not about the cookie value itself. They come from the rules that decide whether the browser stores the cookie, sends it back later, or refuses to include it in a cross-site flow.

Transport
Secure keeps the cookie on HTTPS. If login works locally but breaks after a redirect or proxy hop, start here.
Script access
HttpOnly keeps client-side JavaScript from reading the cookie directly. That matters most for session and refresh cookies.
Cross-site behavior
SameSite decides when the browser sends the cookie on cross-site navigations, embeds, and form submissions.
Scope and lifetime
Domain, Path, Expires, and Max-Age decide where the cookie applies and how long it sticks around.

Developers Usually Land Here When

Use this hub when the browser is doing something annoying but technically correct.

  • A cookie shows up in DevTools but is missing on the next request.
  • Auth works on one subdomain or environment but not another.
  • A login, embedded flow, or CSRF fix changed how cookies travel across sites.

Common Cookie Debug Questions

Which cookie attributes matter most for authentication cookies?

Usually Secure, HttpOnly, and SameSite. They control whether the cookie stays on HTTPS, whether JavaScript can read it, and whether the browser will send it in cross-site situations.

Should I use Expires or Max-Age?

Prefer Max-Age when you can because it is relative and easier to reason about. Expires is still common, but absolute dates are easier to misread and harder to test.

Why does the browser show Set-Cookie but not send the cookie back?

Usually one of three reasons: the cookie was scoped to the wrong domain or path, the browser rejected it because of SameSite or Secure rules, or it expired sooner than you expected.

Browse /search