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.
Set-Cookie lines
Result
What this checks
- Name and value split, with size in octets (name + value over 4096 is ignored by browsers)
- Expires or Max-Age converted to a date, with the 400-day lifetime cap noted
- SameSite=None without Secure
- __Secure- and __Host- prefix rules, matched case-insensitively as browsers do
- Domain, Path, HttpOnly and duplicate or unknown attributes
- Attribute values over 1024 octets, which browsers ignore
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
- Expires and Max-Age set lifetime. Expires is a date; Max-Age is a number of seconds, and if both are present Max-Age wins. With neither, the cookie lasts for the browser session. The draft says user agents should not keep a cookie longer than 400 days, so a longer lifetime is reduced to that cap.
- Domain widens the cookie to a domain and its subdomains. If you omit it, the cookie is "host-only" and goes back only to the host that set it, which is the more restrictive and usually the safer choice.
- Path limits the cookie to URLs under a path. It is not a security boundary between pages on the same host.
- Secure restricts the cookie to HTTPS requests.
- HttpOnly stops page JavaScript from reading the cookie through
document.cookie. The cookie is still sent with requests that scripts make, so it limits theft of the cookie after a cross-site scripting bug, not the bug itself. - SameSite (Strict, Lax or None) controls whether the cookie is sent on cross-site requests.
SameSite=Nonemust be paired withSecure. - Cookie name prefixes. A name starting with
__Secure-must be set with Secure from a secure page. A name starting with__Host-must also have no Domain attribute and a Path of/, which pins the cookie to the exact host.
Limits that cause silent failures
- If name plus value is more than 4,096 octets, the draft's parsing algorithm ignores the entire header.
- An attribute value longer than 1,024 octets is ignored, and parsing goes on to the next attribute.
- Unrecognized attributes are ignored.
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
- Setting a session cookie without
HttpOnly,Secureand an explicitSameSite. - Expecting
Pathto isolate cookies between apps on one host. - Storing a large JWT or user profile in a cookie and exceeding 4,096 octets.
- Setting Domain "for convenience", which sends the cookie to every subdomain.
- Assuming a clean report means the browser will accept the cookie. Third-party cookie rules, partitioning and browser policies are outside the header itself.
Related: JWT expiry and cookie size calculator, security headers analyzer and Cache-Control analyzer.
Common mix-ups
-
Often assumedA cookie marked Secure is protected, so it is safe to keep sensitive data in it.
What the source saysMDN warns not to assume Secure prevents all access to sensitive information. Such a cookie can still be read or changed through the client's disk, or by JavaScript if HttpOnly is not set. [1]
-
Often assumedMax-Age=63072000 keeps a login cookie alive for two years.
What the source saysThe rfc6265bis draft says user agents SHOULD limit a cookie's lifetime to 400 days, setting the expiry to the cap when a larger value arrives. A two-year value is shortened, not honoured. [2]
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
- IETF draft: Cookies, HTTP State Management Mechanism (RFC 6265bis): 4,096-octet name+value limit, 1,024-octet attribute limit, 400-day cap, Max-Age precedence, SameSite (retrieved 2026-10).
- RFC 6265: HTTP State Management Mechanism: original cookie specification and minimum capabilities (retrieved 2026-10).
- MDN: Set-Cookie header: attribute meanings, SameSite=None requires Secure, cookie prefixes, HttpOnly (retrieved 2026-10).