How to parse cookie headers
Paste Cookie request lines or Set-Cookie response lines into Cookie header text. You can also load a .txt, .log, or .http file. The result table shows names, values, attributes, flags, and warnings, with buttons for JSON and CSV copies.
- Paste text into
Cookie header text, or useDrop cookie headers hereandbrowse filesto load a .txt, .log, or .http file. - Set
Header typetoAuto-detect,Cookie (request), orSet-Cookie (response). - Turn on
Decode percent-encoding (name and value)for encoded cookie names or values. - Read the table, then select
Copy as JSONorCopy as CSV.
How Cookie Parser reads Cookie and Set-Cookie headers
Cookie Parser handles each non-empty input line on its own. For a Cookie line, semicolons separate the name-value segments, and each segment becomes a row. For a Set-Cookie line, the first segment is the cookie and later segments become attributes.
Cookie: session_id=abc123; theme=dark
Set-Cookie: sid=xyz789; Path=/; Secure; HttpOnly
The first line creates rows for session_id and theme. The second creates one row for sid, with Path, Secure, and HttpOnly in the attribute columns.
What Header type and percent-decoding change
Auto-detect checks for a Cookie: or Set-Cookie: prefix. Without one, it looks for attributes such as Path or SameSite. Choose a fixed header type when the input has no prefix or when every line should use the same interpretation.
Cookie: user%20name=Riga%20office
With Decode percent-encoding (name and value) selected, the row shows user name and Riga office. An invalid encoded sequence remains unchanged.
Cookie Parser warnings and edge cases
The table marks repeated names as duplicate. A missing equals sign creates an empty value and a warning. For Set-Cookie input, Warnings reports an unknown or repeated attribute, an invalid Max-Age, an invalid Expires date, or an unrecognized SameSite value. If an attribute repeats, the last value is kept.
Blank lines create no rows. Cookie request lines have no attribute values because the parser does not infer them. The selected file is read as text in the browser, and the page does not send the header text through a network request.
Where parsing cookie headers comes up
Paste a request header to check duplicate names before comparing requests. A Set-Cookie line puts its path, expiry, flags, and warnings into separate columns.
Use Copy as JSON for a JSON fixture, or use Copy as CSV when the names and attributes need to be inspected as columns.
When another parser tool fits better
Parser Extract Tools covers structured extraction from logs, headers, and web data. Use Logfmt Parser for Logfmt or Heroku-style key=value log lines. For browser, operating-system, device, and bot details in User-Agent strings, use User-Agent Parser.
Use HTML Table Extractor when the source is HTML and the output needs to be a table in CSV, JSON, or XLSX.
Frequently asked questions
How do I parse a Set-Cookie header?
Paste the line into Cookie header text and leave Header type on Auto-detect, or choose Set-Cookie (response). The first name-value pair becomes the cookie row, and later segments fill the attribute columns.
Can Cookie Parser decode cookie values?
Select Decode percent-encoding (name and value) to decode the name and value fields. A value that cannot be decoded remains as entered.
How are duplicate cookies shown?
Rows with the same parsed name receive a duplicate flag, and the status line counts duplicate names. Each row stays in the result instead of being merged with another entry.
Does Cookie Parser upload header text?
The page reads files and parses the text in your browser. It has no fetch, XMLHttpRequest, sendBeacon, or form submission carrying the header text.