DevTools Logo

Set-Cookie Auditor

Set-Cookie Auditor

Parse every Set-Cookie attribute, decode values and flag missing Secure, HttpOnly, SameSite or prefix mistakes — locally.

Runs in your browser
Set-Cookie response headersSingle name=value line defaults to Set-Cookie; switch modes if it came from a request.
Try an example

Raw headers

Parsing is local and session-only: nothing is uploaded, stored or put in the URL.

Audit context

optional

Needed to check Domain compatibility — without a host the tool cannot judge whether a Domain is too wide. Credential flags use the name heuristic sess/auth/token/sid/jwt/login and label non-credential cookies as warnings.

Audit verdicts

no input

Paste Set-Cookie headers to audit them

One header per line (or a comma-joined proxy copy). Results update as you type; nothing leaves your browser.

Examples

Missing flags on a session cookie

Input
session=abc; Path=/
Output
FAIL: Secure missing → add Secure. FAIL: HttpOnly missing → add HttpOnly. WARN: SameSite missing → set Lax.

The name heuristic treats session as credential-bearing, so the two omissions are hard failures rather than generic warnings.

__Host- prefix violation

Input
__Host-sid=xyz; Path=/; Domain=example.com; Secure; HttpOnly; SameSite=Lax
Output
FAIL — __Host- prefix · no Domain: forbids any Domain attribute. Secure and Path=/ checks pass.

6265bis requires __Host- cookies to be host-only, so even a Domain matching the current host is a violation.

Comma-joined proxy copy

Input
a=1; Expires=Wed, 21 Oct 2035 07:28:00 GMT; Secure, b=2; HttpOnly; Path=/
Output
2 cookies: the RFC date's comma is preserved; the comma before b=2 starts a new cookie.

A comma only splits when the following token looks like name=, which keeps dates and quoted values intact.

Expired cookie with an RFC 850 date

Input
legacy=1; Expires=Wednesday, 21-Oct-2020 07:28:00 GMT
Output
FAIL — already expired; red EXPIRED badge on the card.

All three accepted date formats resolve to the same instant rules, so a legacy format still gets a correct expiry verdict.

About this tool

Set-Cookie Auditor turns pasted response headers into an actionable security review. Each cookie is parsed with RFC 6265 rules — the first '=' splits the name from the value, attributes are case-insensitive, and unknown attributes are listed without judgment — then scored in a flag matrix where every row carries a PASS, WARN or FAIL label, the rule it enforces, and a one-line fix.

The checks go beyond flag presence: SameSite=None without Secure is a hard failure, __Host- and __Secure- prefixes are validated rule by rule, Max-Age takes precedence over Expires, Expires dates are parsed with the RFC 6265 §5.1.1 acceptance grammar (including two-digit years), and expired cookies, public-suffix Domains and duplicate name+scope shadowing are called out. An optional origin host makes Domain compatibility checks computable rather than guessed.

Values are inspected with clearly labeled heuristics: JWT-shaped values reveal their decoded header and claims with exp/iat as dates, printable base64 and percent-encoded values get a decoded preview, and opaque values are shown as-is. JWTs are never signature-verified. You can diff a before/after cookie set to see which flags changed during a fix, copy a corrected Set-Cookie line per card, and export the whole review as Markdown. Parsing is local and session-only — no header, token or session identifier is uploaded, stored or carried in the URL.

What this tool does not do

  • Static flag analysis only: no browser is involved, so no request-behavior or third-party blocking simulation is performed.
  • Expires uses the RFC 6265 §5.1.1 grammar only; exotic or locale-specific formats are reported as unparsed rather than guessed.
  • Cookie-name credential detection is a documented default regex (sess|auth|token|sid|jwt|login), not a semantic understanding of your application.
  • Domain compatibility needs an origin host; without one, only public-suffix rejection and scope notes are available.
  • JWT/base64/percent-encoding detection is heuristic. JWTs are decoded without signature verification and decoded bytes that are not mostly printable are left unpreviewed.
  • At most 500 cookies are rendered per paste; no persistence, URL state or network request is used because headers can carry live session identifiers.

How to use this tool

  1. Paste the headers

    Paste one Set-Cookie header per line, a comma-joined proxy copy, or a Cookie request header. Header-name prefixes and CRLF line endings are stripped automatically.

  2. Confirm the mode

    Auto-detection looks for known attributes, multiple lines and multiple name=value pairs. Use the Auto / Set-Cookie / Cookie header buttons to override a wrong guess.

  3. Add the origin host

    Enter the host that set the cookies so Domain compatibility can be checked. Leave it blank for a pure syntax and flag review.

  4. Read the cards

    Each card shows parsed attributes, a flag matrix with text verdicts and fixes, scope notes and a decode panel. Hover a finding to see its rule.

  5. Fix and compare

    Copy a corrected header from a card, paste the previous header set into Compare, and check which flags moved from FAIL to PASS. Export the Markdown report for a change ticket.

Use cases

App-sec review of an auth flow

Paste every Set-Cookie from login, refresh and logout responses to find missing Secure/HttpOnly, invalid SameSite=None and over-broad Domain attributes in one pass.

Debug a SameSite login regression

See the exact SameSite value and whether Secure is present, then diff before/after headers to confirm the flag actually changed after a deployment.

Verify a __Host- rollout

Check the three named prefix rules independently; a stray Domain or Path=/app is reported with the specific rule it breaks.

Sanity-check a cookie store dump

Paste a Cookie request header to inspect name=value pairs without meaningless flag warnings, or decode a JWT-shaped value to check exp without verifying signatures.

Checks and what each one enforces

CheckRule applied
Secure / HttpOnlyMissing on a name matching sess|auth|token|sid|jwt|login is FAIL; missing on any other name is WARN.
SameSiteAbsent → WARN (browsers default to Lax); Strict/Lax → PASS; None + Secure → PASS; None without Secure or an unknown value → FAIL.
__Host- prefixThree separate rules: Secure present, Path=/ exactly, and no Domain attribute. Expiry does not change prefix validity.
__Secure- prefixSecure must be present; no other prefix-specific requirement is imposed.
Expires / Max-AgeRFC 1123, RFC 850 and asctime dates only; 70–99 → 19xx and 00–69 → 20xx. Max-Age wins when both exist; Max-Age ≤ 0 means immediate deletion, not a session cookie.
Domain / PathHost-only vs .example.com scope note; public suffixes such as com or co.uk are FAIL; origin host compatibility is checked when supplied.
Name / size / duplicatesRFC token name validation, the common 4096-byte per-cookie budget, and same-name+same-scope shadowing warnings.

The rendering cap is 500 cookies per paste; the full input count is reported and the report export covers the rendered cards.

Common mistakes

Mistake:Assuming an expired __Host- cookie is a prefix violation.

Fix:The 6265bis prefix rules are Secure, Path=/ and no Domain. Expiry is a separate check; this tool reports it as its own FAIL row.

Mistake:Treating Max-Age=0 as a session cookie.

Fix:RFC 6265 maps Max-Age ≤ 0 to immediate deletion. Session means neither Max-Age nor Expires is present — the card labels both states differently.

Mistake:Expecting any parseable date string to be honored by browsers.

Fix:Only RFC 1123, RFC 850 and asctime are in the §5.1.1 grammar. Unparseable dates are labeled WARN and treated as session cookies; no lenient Date.parse fallback is used.

Mistake:Judging whether a Domain is too wide without knowing the setting host.

Fix:Add the origin host in Audit context. Without it the tool shows scope notes and rejects public suffixes, but does not guess compatibility.

Mistake:Trusting decoded JWT claims as authenticated identity.

Fix:The decode panel is an unsigned view: header and payload are parsed for convenience, but the signature, issuer and audience are not verified.

Frequently asked questions

What does SameSite=Lax actually allow?

Lax sends the cookie on same-site requests and on top-level cross-site navigations that use a safe method such as GET, but not on cross-site subrequests like images, fetch calls or form POSTs. It is the browser default when SameSite is absent, which is why a missing attribute is reported as a warning rather than a hard failure. Use Strict when the cookie should never follow cross-site navigation, and SameSite=None; Secure only when a deliberate cross-site flow needs it.

When is __Host- required?

__Host- is not mandatory for all cookies; it is an opt-in prefix that gives you a browser-enforced guarantee that the cookie is host-only and sent only over HTTPS. 6265bis requires three things: the Secure attribute, Path=/ exactly, and no Domain attribute at all. The auditor checks each rule separately and names the violated one. A cookie that expires does not become a prefix violation — expiry is reported independently.

Why do Set-Cookie headers use commas in Expires dates?

RFC 1123 dates such as Wed, 21 Oct 2026 07:28:00 GMT and RFC 850 dates such as Wednesday, 21-Oct-26 07:28:00 GMT contain a comma by design. Because multiple Set-Cookie headers are sometimes joined onto one line by proxies, a naive comma split cuts the date in half. This tool only starts a new cookie at a comma followed by a name= token, so dates and quoted values remain intact.

Does Secure matter on localhost?

Browsers have special-case exceptions that may let a Secure cookie be set on localhost even over http, but that behavior is not portable to staging or production and does not make the flag optional in your code. Keep Secure on auth cookies and test the production-like host over HTTPS. The auditor reports the flag statically and does not simulate browser localhost exceptions.

Can two cookies have the same name?

Yes, but only when Domain and Path differ. Browsers key cookies by name+domain+path, so a later Set-Cookie with the same triple replaces the earlier cookie instead of coexisting with it. That silent overwrite is a common cause of broken logins. The auditor adds a duplicate name+scope warning to the later card so you can catch it before it reaches production.

Is my session data sent anywhere when I use this tool?

No. Parsing, decoding, diffing and Markdown export all run in your browser tab. Nothing is uploaded, stored in local storage, or placed in the URL. Decoded JWTs are unsigned views only — the signature is not checked, so treat the claims as untrusted input.

References & standards