logo
GeekFormat

Cookie Parser

NameValueAction
Paste content above to see parsed results

Netscape cookie files can be used with curl -b; if Domain is missing, a placeholder domain is used. Replace it before import.

One page for understanding both Cookie request headers and Set-Cookie response headers during login, API, and browser debugging.

Related

What is a Cookie Parser?

A cookie parser turns cookie text taken from browsers, frontend code, API tools, or server responses into structured results. It does not try to explain cookie theory in the abstract. Instead, it focuses on the questions that come up in real debugging: which cookies were actually sent with the current request, which attributes appear in the Set-Cookie response header, why SameSite / Secure / HttpOnly looks correct but the browser still refuses the cookie, whether the cookie value was URL-encoded, and how to reuse the parsed result in scripts or command-line tools.

A common mistake in lightweight tools is treating document.cookie, the Cookie request header, and the Set-Cookie response header as if they were the same input shape. They are not. document.cookie and request cookies are best viewed as flat name=value pairs, where the main task is checking whether the request carried the right cookies. Set-Cookie is a server-to-browser response header, and the key task there is checking whether SameSite, Path, Domain, Expires, Max-Age, HttpOnly, and Secure were configured correctly.

This page works as a general entry point when you are not yet sure which kind of cookie text you have, or when you are investigating a full login-state problem and need to compare both what the request sent and what the server returned. You can switch between Cookie-string mode and Set-Cookie mode on one page and quickly parse, inspect, filter, copy, and export the result.

Compared with simple online tools that only do split(;), this parser is designed around real debugging readability and reuse. It preserves the raw value while safely showing a decoded value, exposes attribute tables, exports JSON and Netscape Cookie File output, and keeps duplicate cookies visible instead of auto-cleaning away the very signal you may need to diagnose the issue.

If you later need a more focused request-header workflow, use the dedicated HTTP Cookie Parser. If you need to understand why the browser rejected a cookie, whether SameSite=None is missing Secure, or whether Set-Cookie security attributes are invalid, switch to the specialized Set-Cookie Parser. This page is best understood as the main cookie debugging hub and routing page.

Use Cases

  • Take a document.cookie string from DevTools or logs and quickly split it into individual cookie items
  • Paste multi-line Set-Cookie response headers from the Network panel to see why the browser refused a cookie
  • Investigate lost login state, missing cross-site cookies, and duplicate-name cookie conflicts
  • Decode URL-encoded cookie values into readable text to confirm the real content
  • Convert parsed cookies into JSON for scripts, issues, docs, or test cases
  • Generate Netscape Cookie File text for curl, crawlers, or import-based tooling
  • Use it as the general cookie triage page during frontend, QA, ops, and crawler debugging

How to Use

  1. Identify the source first: use Cookie-string mode for document.cookie, request headers, or logs, and Set-Cookie mode for response headers
  2. Paste the raw cookie text into the input area, and the tool will split names, values, and attributes automatically
  3. Turn on URL-decoded values, filter important fields, and inspect duplicate-name warnings or attribute tables as needed
  4. Copy the normalized text, export JSON, or generate a Netscape Cookie File for the next step in your debugging workflow

Features

  • Dual-mode parsing for document.cookie / Cookie request headers and multi-line Set-Cookie response headers
  • Automatic name, value, and attribute breakdown with raw values, URL-decoded values, and SameSite / Secure / HttpOnly / Path / Domain / Expires / Max-Age fields
  • Duplicate-name warnings to help locate path conflicts, overlapping scopes, and unstable login state behavior
  • Structured JSON export for scripts, API debugging, and reproducible bug reports
  • Netscape Cookie File generation for curl and crawler toolchains that still consume that format
  • Local-only processing so Session, Token, and login cookies stay on your machine
  • Clear separation between request-side and response-side cookie debugging, making it a practical general entry point

How should you choose between cookie parsing tools?

This page works well as the main cookie debugging entry point, but if you already know what kind of data you have, a specialized tool will be faster.

ToolBest inputBest forCore strength
Cookie Parser (this page)Cookie strings, document.cookie, multi-line Set-CookieWhen you are not sure about the input type or want to handle request and response cookies in one placeDual-mode switching, JSON / Netscape export, and a practical main cookie debugging hub
HTTP Cookie ParserCookie request headers and document.cookie-style stringsChecking which cookies the request actually carried, whether names are duplicated, and whether values were URL-encodedMore focused on request-side name/value parsing for sessions and login-state debuggingOpen HTTP Cookie Parser
Set-Cookie ParserSet-Cookie response headers returned by the serverChecking why the browser refused a cookie and whether SameSite / Secure / HttpOnly settings are riskyDeeper attribute inspection for security settings and browser-policy issuesOpen Set-Cookie Parser

Best Practices

Identify first whether you have a request header or a response header

If the text came from frontend code, document.cookie, request logs, or a curl header, start with Cookie-string mode. If it came from Response Headers in the browser Network panel, switch to Set-Cookie mode instead, or you will misread attributes as plain key-value data.

HTTP Cookie ParserSet-Cookie Parser

Do not drop the raw value when viewing URL-decoded output

Many cookie values are URL-encoded. During debugging you should keep both the raw value and the decoded value visible, especially when you are checking signatures, Base64, JWT, or double-encoding done by the server.

When names are duplicated, inspect Path and Domain before deduplicating

Duplicate cookies usually mean different paths, different domains, or leftover writes from earlier flows. Auto-deduplication can hide the real root cause. It is safer to keep duplicates visible and compare them against the request path, scope, and Set-Cookie configuration.

Choose the export format based on the next consumer in your workflow

If you only want to paste the result into docs, an issue, or a script, JSON is usually clearer. If you want to feed the result into curl, a crawler, or a tool that imports cookie files, choose Netscape Cookie File instead.

curl to code

FAQ

What input formats does this cookie parser support?

It supports two main input types: flat name=value; name2=value2 strings such as document.cookie or a Cookie: request header, and multi-line Set-Cookie response headers copied from the browser Network panel. The first is best for seeing which cookies were actually sent in a request, while the second is better for checking SameSite, Secure, HttpOnly, Path, Domain, Expires, and Max-Age settings.

What is the difference between a Cookie request header and a Set-Cookie response header?

A Cookie request header is the flat key-value list the browser sends to the server, without attribute metadata. Set-Cookie is the response header the server sends back to the browser. Each line describes one complete cookie configuration and can include Path, Domain, Expires, SameSite, Secure, HttpOnly, and other attributes in addition to the name and value. Use Cookie parsing to debug what the request carried, and Set-Cookie parsing to debug why the browser accepted or rejected a cookie.

Why does the cookie value look garbled?

Many cookie values are URL-encoded. For example, %3D means = and %2F means /. The tool keeps the raw value and also shows the URL-decoded version so you can confirm the real content without losing the original input.

Why do duplicate cookie names appear?

Duplicate names can come from different Paths, different Domains, or repeated writes during debugging. The duplicate itself is often an important clue, so the tool warns you about it instead of deduplicating automatically and hiding the real issue.

When should I use JSON export versus Netscape export?

JSON export is better when you want to keep working with scripts, test cases, API docs, or log analysis. Netscape Cookie File export is better when you want to reuse cookies in tools or command-line flows that support that format, such as curl -b. JSON is more structured, while Netscape format is better for compatibility with older cookie workflows.

Is this tool good for investigating lost login state?

Yes. You can first inspect which cookies the request actually carried in Cookie mode, then switch to Set-Cookie mode to check whether the server-side attributes are wrong, such as SameSite=None without Secure, a mismatched Path, an invalid Max-Age, or the wrong Domain scope.

If I only want to inspect request cookies, why use this combined parser?

The combined parser is useful when your debugging session may involve either document.cookie or Set-Cookie and you want one entry point. If you already know you only need request cookies, the dedicated HTTP Cookie Parser is more focused. If you only need response headers, the Set-Cookie Parser goes deeper on attribute validation and security checks.

Will the Session, Token, or login cookies I paste here be uploaded to a server?

No. Cookie parsing, URL decoding, JSON preview, and Netscape text generation all run locally in your browser. Nothing you paste is uploaded, which makes the page suitable for sensitive cookies copied from test, staging, or even production troubleshooting flows.

Does it automatically recognize SameSite, Secure, and HttpOnly in Set-Cookie?

Yes. The tool parses each Set-Cookie line and shows structured fields such as SameSite, Secure, HttpOnly, Path, Domain, Expires, Max-Age, and Partitioned so you do not need to count semicolons by hand in the raw header.

Can I reuse the parsed result directly in curl or scripts?

Yes. In request-header mode you can copy normalized Cookie content. The combined parser also exports JSON and Netscape Cookie File text so you can continue using the result in curl, crawler scripts, API testing tools, or automation tasks.

Glossary

Cookie request header
The set of cookie name-value pairs the browser automatically includes in an HTTP request, typically in the form name1=value1; name2=value2. It only contains the values that the current request will send, not attributes such as Path, Domain, HttpOnly, or SameSite.HTTP Cookie Parser
Set-Cookie response header
The HTTP response header a server uses to set a cookie. Each line usually defines one cookie and can include Path, Domain, Expires, Max-Age, SameSite, Secure, HttpOnly, and other attributes in addition to name=value.Set-Cookie Parser
document.cookie
The cookie-string interface frontend scripts can read. It usually looks like multiple name=value pairs separated by semicolons. It does not include HttpOnly cookies and does not expose full Set-Cookie attribute metadata.
SameSite
An attribute that controls whether cookies are sent in cross-site requests. Common values are Strict, Lax, and None. It is critical when investigating cross-site login state, SSO, and embedded page cookie loss.
HttpOnly
A Set-Cookie security attribute. When present, frontend JavaScript cannot read the cookie through document.cookie, which mainly helps reduce the risk of session theft through XSS.
Secure
A Set-Cookie security attribute. When present, the cookie is only sent over HTTPS connections, with localhost as a special local exception.
Netscape Cookie File
A long-standing cookie text file format that is still widely supported by command-line tools, crawler workflows, and import scripts.
URL-encoded cookie value
A cookie value that uses percent-encoding for special characters, such as %2F or %3D. During debugging you usually want to compare the raw value with the URL-decoded one.URL Encode Tool
Duplicate cookie name
The same cookie name appearing more than once in one request, often because of different Paths, different Domains, or leftover historical writes. Duplicates can be a direct clue behind unstable login state or scope conflicts.

Quick guide to the three common cookie input shapes

Many cookie debugging problems come from misidentifying the input shape before you even start parsing.

Input typeTypical exampleContainsBetter tool
document.cookie / Cookie request headersession=abc; theme=dark; lang=zh-CNOnly flat name=value pairs, without attributesCookie-string mode on this page, or the HTTP Cookie Parser
Set-Cookie response headersession=abc; Path=/; HttpOnly; Secure; SameSite=Laxname=value plus security and lifetime attributesSet-Cookie mode on this page, or the Set-Cookie Parser
Netscape Cookie File.example.com TRUE / FALSE 0 sid abc123Domain, path, secure flag, expiry time, name, and valueThis page can generate it for reuse in curl and scripts

High-frequency cookie debugging problem table

When you troubleshoot cookies, first separate request-side missing cookies from browser-side rejection.

SymptomLikely causeCheck first
The target cookie is completely missing from the requestThe cookie was never written successfully, or Path / Domain scope does not matchInspect Set-Cookie mode first, then inspect request-header mode
Cross-site requests do not send cookiesSameSite restrictions, missing Secure, or browser third-party cookie policyCheck first whether SameSite=None is paired with Secure
The cookie value looks garbledThe value was URL-encoded, or wrapped again in Base64 / JWT by the serverOpen the decoded view, then continue with JWT / Base64 if needed
Cookies with the same name behave inconsistentlyMultiple writes exist under different Paths or DomainsKeep duplicates visible and compare scope plus write origin
curl or scripts cannot directly reuse browser cookiesYou are missing a standardized export formatSwitch to JSON export or Netscape Cookie File export

Privacy & Security

Cookie parsing, URL decoding, JSON preview, and Netscape text generation all happen locally in your browser. Session, Token, login cookies, and copied response headers are not uploaded to any server.