Skip to content
ZeroServer.tools

HTTP Cookie Builder

Generate a Set-Cookie header with all attributes — Path, Domain, Max-Age, Expires, Secure, HttpOnly, and SameSite.

Set-Cookie header
Set-Cookie: session=abc123; Path=/; HttpOnly; SameSite=Lax

Set-Cookie header attributes explained

The Set-Cookie HTTP response header stores a small piece of data in the browser. Key attributes: HttpOnly prevents JavaScript from reading the cookie (mitigates XSS); Secure ensures it is only sent over HTTPS; SameSite=Lax or Strict protects against CSRF; and Max-Age sets an expiry in seconds relative to the current time (preferred over Expires).

For related security headers, see the HTTP Security Header Generator or the CSP Generator.

Private & free — this tool runs entirely in your browser.

Recommended: Namecheap Register a domain for your next project — from $1.98/yr.affiliate

Related Web & SEO tools