Worked examples
| Example | Input | Result |
|---|---|---|
| Simple session cookie | Cookie string: session_id=abc123; Output format: json | { / "session_id": "abc123" / } |
| Multiple cookies with attributes | Cookie string: id=a3fWa; Expires=Thu, 21 Oct 2025 07:28:00 GMT; Secure; HttpOnly; theme=dark; Path=/; Output format: json | { / "id": { / "value": "a3fWa", / "Expires": "Thu, 21 Oct 2025 07:28:00 GMT", / "Secure": true, / "HttpOnly": true / }, / "theme": { / "value": "dark", / "Path": "/" / } / } |
| URL-encoded value | Cookie string: user=john%40example.com; lang=en-US; Output format: table | Cookies found: 2 |
FAQ
What does this cookie parser do?
It takes a raw HTTP cookie string and breaks it down into individual name-value pairs, extracting attributes like Path, Domain, Expires, Secure and HttpOnly into a structured format.
Does it handle both Cookie and Set-Cookie headers?
Yes. Simple Cookie headers produce a flat list of pairs. Set-Cookie strings with attributes are parsed so that attributes are correctly associated with their parent cookie.
Are percent-encoded values decoded automatically?
Yes. Values like %40 are converted back to their original characters, matching the behavior of standard URL decoding functions.
Is my cookie data sent to a server?
No. The parsing logic runs entirely in your browser. Your cookie strings are never transmitted anywhere.
What happens if a cookie has no value?
A cookie like token= is valid and will be parsed with an empty string as its value. However, a segment with no name at all will trigger an error.
Can I parse multiple Set-Cookie headers at once?
Yes. Paste each Set-Cookie header on its own line (a leading "Set-Cookie:" or "Cookie:" label is fine) and every line is read as a separate cookie with its own attributes. If the same cookie name appears twice, both are kept as a list.