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.
Reference
Start here when a cookie behaves differently than you expected across environments, subdomains, or cross-site requests.
Learn how the Domain cookie attribute controls which domains can access cookies. Understand subdomain sharing, security implications, and restrictions.
Learn how the Expires cookie attribute sets an absolute expiration date. Understand date formats, timezone handling, and when to use Expires vs Max-Age.
Learn how the HttpOnly cookie attribute protects against XSS attacks by preventing JavaScript access to sensitive cookies.
Learn how the Max-Age cookie attribute sets expiration in seconds from now. Understand why Max-Age is preferred over Expires for reliable lifetime control.
Learn how the Path cookie attribute restricts which URL paths can receive cookies. Understand path matching rules and how to scope cookies to specific routes.
Learn how the SameSite cookie attribute prevents CSRF attacks, the differences between Strict, Lax, and None, and when to use each.
Learn how the Secure cookie attribute ensures cookies are only sent over HTTPS connections. Protect sensitive data from man-in-the-middle attacks.
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.
Use this hub when the browser is doing something annoying but technically correct.
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.
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.
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.