Cookies · Response header
Set-Cookie
Sends a cookie to be stored by the client.
What is Set-Cookie?
Set-Cookie is how servers create browser cookies. Attributes control lifetime (Max-Age/Expires), scope (Domain/Path), and safety (Secure, HttpOnly, SameSite).
Typical usage
Set on responses that establish or update session state.
Examples
Secure session cookie
Set-Cookie: session=abc; Path=/; Max-Age=3600; HttpOnly; Secure; SameSite=LaxCross-site cookie (embedded auth)
Set-Cookie: token=xyz; Path=/; Secure; SameSite=NoneCommon gotchas
SameSite=None requires Secure. Missing Secure with SameSite=None causes the browser to silently reject the cookie.
Specification
RFC 6265bis