Cookie Parser: Reading Attributes, What JavaScript Sees, and Why Not to Paste Real Tokens

Open Tool Cookie Parser

Structure of a cookie string

A Cookie header is semicolon-separated pairs such as sessionid=38afes7a8; logged_in=true; theme=dark. When a response sets a cookie it also appends attributes after semicolons: Domain limits the host, Path limits the path, Expires or Max-Age sets lifetime, Secure restricts sending to HTTPS, HttpOnly hides it from scripts, and SameSite governs cross-site requests. Attributes are not values, so parsing must separate them or Secure gets misread as a variable named Secure.

Steps

  1. Paste the string copied from browser dev tools into the cookie field.
  2. Click Parse for a table of name, value and type, with surrounding quotes stripped, an optional form RFC 6265 allows.
  3. Download exports TSV for Excel filtering and counting.
  4. Example shows a standard string and Clear resets.

Why stripping quotes matters

Some servers write values with double quotes, as in token="abc". Scripts that split on the equals sign then compare strings end up comparing the quoted text, which never matches — a common bug in session checks. The tool removes the outer quotes so you see the real value, and it also tells you to handle that optional form in your own parser rather than assuming values are unquoted.

Which cookies scripts cannot see

HttpOnly cookies are invisible to document.cookie by design, protecting session tokens from XSS. A string copied from script therefore lacks HttpOnly entries, while one copied from dev tools request headers is complete, and that difference gets misread as a missing cookie. Secure cookies are not sent over http, and SameSite=None requires Secure or the browser refuses the cookie — the two rules behind most logged-in-then-logged-out reports.

Security note

A sessionid inside a cookie is the account itself. Do not paste it into an unfamiliar online tool, and do not share parsed output in a group chat. Debug locally, or replace values with dummy strings of equal length, since the structure is what matters and the value does not need to leave your machine. If it has already leaked, invalidate that session server-side and force a re-login.

⏫︎