Security · cookies

Set-Cookie inspector.

Paste one or more Set-Cookie lines and see what a browser would read from each: name, value, Domain, Path, expiry and flags. Nothing leaves this page.

RFC 6265bis draft + MDN reviewed 30 September 2026Format check only · not a browser test

Advertisement

Set-Cookie lines

Result

Advertisement

What this checks

Sources and limits

Parsing follows the user-agent algorithm in draft-ietf-httpbis-rfc6265bis (sections 4.1, 5.1.1, 5.4, 5.5 and 5.6), which updates RFC 6265. The SameSite=None and Secure rule comes from MDN: Set-Cookie.

The 4096 limit is on the name and value together, in octets, as the draft states. Browsers differ in how they count attributes toward their own limits, so keep cookies well under it. A clean result means the header is well formed, not that a browser on your origin will accept or send the cookie. The draft is still a draft and may change.

What a Set-Cookie header is

A server creates a cookie by sending a Set-Cookie response header. The first part is a name=value pair; everything after it, separated by semicolons, is an attribute that tells the browser how long to keep the cookie, which hosts and paths to send it to, and which security restrictions apply. A mistake in the header rarely produces an error. The browser just ignores part of it or the whole cookie, which is why a tool that shows what a browser would actually read is useful. This page parses each line you paste, following the user-agent algorithm in the HTTP Working Group's RFC 6265bis draft, and reports problems alongside what each attribute does.

The attributes, one by one

Limits that cause silent failures

RFC 6265 only guarantees room for at least 50 cookies per domain and 3,000 in total, and recommends that servers use as few and as small cookies as possible.

Worked example

Consider the header Set-Cookie: session=abc123; Path=/; Secure; HttpOnly; SameSite=None; Max-Age=31536000. The tool reads the name session, the value abc123 (13 octets together with the name, far below 4,096), a host-only cookie because Domain is missing, HTTPS-only, hidden from scripts, sent on cross-site requests, and a lifetime of 31,536,000 seconds, which is 365 days and under the 400-day cap. Now change it to SameSite=None without Secure: the inspector flags it, because MDN states that the Secure attribute must also be set when SameSite=None is used. Rename the cookie to __Host-session but leave Domain=example.com on it and it flags that too, because a __Host- cookie may not carry a Domain attribute.

Common mistakes

Related: JWT expiry and cookie size calculator, security headers analyzer and Cache-Control analyzer.

Advertisement

Common mix-ups

  1. MDN: Set-Cookie header
  2. IETF draft: Cookies, HTTP State Management Mechanism (rfc6265bis)

Checked against these sources on .

Frequently asked questions

What does the SameSite=None attribute require?

It requires the Secure attribute. MDN states that the Secure attribute must also be set when SameSite=None is used, so a cookie with SameSite=None and no Secure is invalid. SameSite=None lets the cookie be sent on cross-site requests, so use it only when you need that, for example for an embedded third-party widget.

How big can a cookie be?

Under the RFC 6265bis parsing algorithm, if the name and value together are more than 4,096 octets, the whole Set-Cookie header is ignored. Attribute values over 1,024 octets are ignored individually. Keep cookies far below these limits.

What is the difference between Expires and Max-Age?

Expires gives a calendar date and Max-Age gives a number of seconds from now. If a cookie has both, Max-Age takes precedence. Without either, the cookie is a session cookie. The draft says user agents should cap the lifetime at 400 days.

What do the __Host- and __Secure- prefixes do?

They make the browser enforce extra rules. __Secure- requires the Secure attribute and a secure page. __Host- also requires no Domain attribute and a Path of /, so the cookie can only come from and go back to the exact host.

Does HttpOnly stop cross-site scripting?

No. It only prevents scripts from reading the cookie through document.cookie. The browser still attaches the cookie to requests that scripts make, so an XSS bug can still act as the user. HttpOnly reduces what an attacker can steal; it does not remove the bug.

What happens if I leave out Domain?

The cookie becomes host-only. It is returned only to the exact host that set it and not to its subdomains. This is usually the more restrictive and safer behaviour.

Does this tool tell me whether a browser will accept my cookie?

No. It reads the header the way the specification describes and flags format problems. Browsers add their own policies, such as third-party cookie blocking, so test in a real browser's developer tools as well.

Sources