Cookie Parser
Paste a Cookie request header or Set-Cookie response headers. This cookie parser decodes every value, explains Expires, Max-Age, Domain, Path, Secure, HttpOnly and SameSite, and warns about cookies browsers will reject.
Put each Set-Cookie header on its own line. A Cookie header holds all cookies on one line, separated by semicolons. The header name prefix is optional.
| # | Name | Value | Size |
|---|
| # | Name | Value | Domain | Path | Expires | SameSite | Flags | Size |
|---|
Fill in the fields to write a Set-Cookie header. The same checks run on the result.
Empty for a session cookie, 0 to delete.
Read and Debug HTTP Cookies
When a login does not stick, a cart empties itself or a cookie works on staging but not in production, the answer is usually in the headers. Copy the Set-Cookie lines from your browser's network panel or from curl -i, paste them here and every attribute is laid out in a table, with dates converted to readable times.
The parser applies the rules browsers use. It warns about SameSite=None without Secure, broken __Host- and __Secure- prefixes, unreadable dates and oversized cookies. A builder writes correct headers for you. Everything runs in your browser.
How to parse cookies
- Copy the headers. In Chrome or Firefox DevTools, open the Network tab, select a request and copy the
Cookierequest header or theSet-Cookieresponse headers.curl -i https://example.comprints them too. - Paste them into the box. Put each Set-Cookie header on its own line. The
Set-Cookie:orCookie:prefix is optional, and the type is detected automatically; use the buttons above the box to force it. - Read the table and the warnings. Each cookie shows its decoded value, domain, path, expiry (as a UTC date with time remaining), SameSite mode, flags and size.
- Copy the JSON for a bug report or test fixture, or use the builder to write a corrected header.
Cookie vs Set-Cookie
Cookies travel in two different headers. The server sends one Set-Cookie header per cookie in a response, each with its own attributes. The browser stores the cookie and sends it back in a single Cookie request header, which only holds name=value pairs separated by semicolons: no expiry, path or flags. That is why the Cookie header table only shows names, values and sizes.
Some HTTP clients, including fetch() in Node.js when you call headers.get('set-cookie'), join several Set-Cookie headers into one line with commas. The parser splits such lines again, but only at commas followed by a new name=, so the comma inside a date such as Expires=Wed, 21 Oct 2015 07:28:00 GMT is left alone. Attribute names are case-insensitive, and if an attribute appears twice the last one wins, as in browsers.
Set-Cookie attributes reference
| Attribute | Example | What it does |
|---|---|---|
Expires | Expires=Wed, 21 Oct 2026 07:28:00 GMT | Date after which the cookie is deleted. Without Expires or Max-Age the cookie lasts for the session. |
Max-Age | Max-Age=3600 | Lifetime in seconds. Takes precedence over Expires. Zero or a negative value deletes the cookie. |
Domain | Domain=example.com | Sends the cookie to this domain and all subdomains. Without it the cookie is host-only. |
Path | Path=/shop | Sends the cookie only for URLs under this path. |
Secure | Secure | Only sent over HTTPS (and to localhost in current browsers). |
HttpOnly | HttpOnly | Hidden from document.cookie, which limits damage from XSS. |
SameSite | SameSite=Lax | Strict: same-site requests only. Lax: also top-level navigations. None: all requests, requires Secure. |
Partitioned | Partitioned | CHIPS: stores a separate copy per top-level site for embedded third-party content. Requires Secure. |
Priority | Priority=High | Chrome-only hint (Low, Medium, High) for which cookies to evict first when a domain has too many. |
Why browsers reject or drop cookies
- SameSite=None without Secure. Since 2020, Chrome and other browsers refuse such cookies. Add
Secureand serve the site over HTTPS. - Broken prefixes. A
__Secure-cookie must be Secure. A__Host-cookie must also havePath=/and noDomain, which locks it to one exact host. - Too large. Browsers commonly allow about 4,096 bytes for a cookie's name and value, and also limit the number of cookies per domain.
- Already expired. A past Expires date or
Max-Age=0tells the browser to delete the cookie. To delete a cookie, the Path and Domain must match the ones it was set with. - Domain mismatch. A site cannot set a cookie for an unrelated domain or for a public suffix such as
co.uk. A leading dot in Domain is a leftover from old specifications and is ignored. - Very long lifetimes are shortened: Chrome caps Expires and Max-Age at 400 days, as the current draft of the cookie standard requires.
Cookie security tips
- Session and auth cookies should be
Secure; HttpOnly; SameSite=Lax(orStrict), ideally with the__Host-prefix. - Encode values. Spaces, commas, semicolons and quotes are not allowed in cookie values without encoding; URL-encoding is the usual choice and is what the decoder reverses.
- Do not store secrets in readable cookies. Values can be read and changed by the user; sign or encrypt them on the server.
- Mind the clock. Expires is compared with the user's computer clock; Max-Age avoids problems with wrong clocks. Convert raw expiry timestamps with the Unix timestamp converter.
- Inspect whole sessions with the HAR viewer, check redirect and callback URLs with the URL parser, and see which browser sent a request with the user agent parser.
Frequently Asked Questions
Common questions about cookies and the Set-Cookie header.
Set-Cookie is a response header: the server uses one per cookie to create or update it, with attributes such as Expires and Path. Cookie is a request header: the browser sends all matching cookies back as name=value pairs on one line.
Browsers only accept SameSite=None when the cookie also has the Secure attribute, which means it is only sent over HTTPS. Add Secure and the cookie will be stored.
Max-Age wins. The cookie expires the given number of seconds after it was received, and the Expires date is only used by very old clients that do not support Max-Age.
A cookie without Expires or Max-Age. It is deleted when the browser session ends, although browsers that restore your tabs on restart may keep it longer.
Name prefixes that browsers enforce. __Secure- cookies must be Secure. __Host- cookies must be Secure, have Path=/ and no Domain, so a subdomain cannot overwrite them.
Send a Set-Cookie header with the same name, Path and Domain and either Max-Age=0 or an Expires date in the past. The parser marks such cookies as expired.
HttpOnly cookies are hidden from JavaScript by design. Copy them from the Network or Application tab of your browser's developer tools instead.
No. Parsing runs in your browser with JavaScript, so session IDs and tokens you paste are not uploaded. Still, treat them as secrets and avoid pasting live production tokens anywhere you do not need to.