How to use the set-cookie header parser
- Paste the header lines, one per line. Start each with Set-Cookie: for a response header or Cookie: for a request header. A line with no prefix is read as a Set-Cookie value.
- Enter the date the response arrived, in UTC, if you want Max-Age turned into an expiry date and past dates flagged. You can leave it blank.
- Read the table of cookies for the name, value and settings of each one.
- Read the second table for problems and notes, each tied to the number of the cookie it belongs to.
Formula
name-value pair = text before the first semicolon, split at the first equals sign
attributes = each later piece, name matched without regard to capital letters
Max-Age wins over Expires when both are set
expiry from Max-Age = date received + Max-Age seconds
This follows RFC 6265. A Max-Age of zero or less, or an Expires date in the past, tells the browser to delete the cookie at once.
Four sample headers
The first header sets a session cookie with Secure, HttpOnly, SameSite=Lax, Path=/ and a Max-Age of 3,600 seconds, which is 1 hour. It has no problems. The second sets a theme cookie with SameSite=None but no Secure attribute, which current browsers reject, so it is reported as a problem. Its Domain=.example.com has a leading dot, which browsers ignore.
The third, __Host-token, passes the strict rules for its prefix: Secure, Path=/ and no Domain. The fourth line is a Cookie request header with session, theme and theme again, and the repeated name is noted. In total six cookies are read, with one problem and four notes.
What counts as a problem
Problems are things that make a browser reject or cut short a cookie, or that make the header malformed: SameSite=None without Secure, a __Host- or __Secure- cookie that breaks its prefix rules, a name or value with characters RFC 6265 does not allow, a Max-Age that is not a number, a date browsers cannot read and a cookie bigger than about 4,096 bytes.
Notes are observations that may or may not matter: no Secure attribute, no HttpOnly attribute, no SameSite attribute, a Domain with a leading dot, both Max-Age and Expires, or a cookie that deletes itself. Whether a missing attribute matters depends on what the cookie is for.
Reading attributes
Secure keeps the cookie off plain HTTP. HttpOnly hides it from scripts on the page. SameSite controls whether it is sent on requests started from other sites. Domain widens the cookie to subdomains, and Path limits which parts of a site receive it. A cookie with no Max-Age or Expires lasts only for the browser session.
To read the caching rules that come in the same response, use the HTTP Cache-Control Explainer. To look up a status code, see the HTTP Status Codes page, and for a token that carries claims, the JWT Decoder.
Assumptions and limits
- Only the text you paste is read. Nothing is sent or checked against a live site.
- Dates are read in three common shapes and treated as UTC. Two-digit years of 70 to 99 mean 1970 to 1999 and 00 to 69 mean 2000 to 2069.
- The size check counts the bytes of the name and value in UTF-8.
- Real browsers add rules of their own, such as limits on cookies per site and blocking of third-party cookies, and these change over time.
- Up to 100 lines are accepted, and nothing typed here leaves your browser.
Frequently asked questions
Why is SameSite=None a problem without Secure?
Current browsers require the Secure attribute on cookies that ask to be sent in cross-site requests with SameSite=None. Without it they reject the cookie, so it never gets stored.
What happens when both Max-Age and Expires are set?
Max-Age takes priority and Expires is ignored. Setting both is allowed and is sometimes done for older clients, but the page notes it because only one of them has an effect.
What does the __Host- prefix require?
The cookie must have the Secure attribute, Path=/ and no Domain attribute. If any of those is missing, browsers that support prefixes reject the cookie.
Why does the page not know the expiry date of a Max-Age cookie?
Max-Age counts seconds from the moment the browser receives the response. Without a received date, the page shows the length. Enter the date to see an expiry date.