Set-Cookie

Server instructs the client to store a cookie. Can include HttpOnly, Secure, SameSite, Max-Age.

Response

Syntax

Set-Cookie: <name>=<value>[; <attr>]*

Example values

ValueExplanation
session=abc123; Path=/; HttpOnly; Secure; SameSite=StrictSecure session cookie
pref=dark; Max-Age=31536000Preference, 1 year

cURL usage

curl -i https://example.com/login  # Inspect Set-Cookie in response

Common mistakes

Missing HttpOnly for session cookies; SameSite=None without Secure.

Related headers

Tools

HTTP Header Viewer →