Start a project

Tool 68 of 100 · HTTP

Set-Cookie Analyser

Paste Set-Cookie headers and see which cookies are exposed to scripts, sent cross-site or too broad, with a corrected header for each.

Set-Cookie Analyser at a glanceIllustration: 1, Set-Cookie headers; 2, processed in your browser; 3, Checks + a safe version.Set-Cookie Analyser1Set-Cookie headers3Checks + a safe version2In yourbrowser
1 Set-Cookie headers 2 processed on your device 3 Checks + a safe version

Set-Cookie Analyser

Set-Cookie headers

Safer versions

Suggested Set-Cookie headers

Check that your front end doesn't need to read a cookie before adding HttpOnly, and rename cookies in your app code too.

Each cookie

    01

    What it does

    Parses Set-Cookie headers and checks security flags, prefixes, scope, lifetime and size, then writes a safer header.

    • Parses RFC 6265bis Set-Cookie headers
    • Secure, HttpOnly and SameSite checks
    • __Host- and __Secure- prefix rules
    • Partitioned (CHIPS) and third-party notes

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    A report and safer Set-Cookie headers, with a Copy and a Download button on every result.

    • Cookies
    • Security
    • HTTP
    • SameSite

    Why it matters

    Session cookies are the keys to your users' accounts. A cookie without HttpOnly can be stolen by any script injected into the page; one without Secure can travel over plain HTTP; and a broad Domain shares it with every subdomain.

    This analyser parses each Set-Cookie header the way browsers do, checks it against the current cookie rules (including the 400-day lifetime cap and prefix rules), and writes a corrected version, so a code review or a pen-test finding takes minutes to fix.

    How it works

    1. InputOne or more Set-Cookie headers
    2. In your browserChecked for Secure, HttpOnly, SameSite and prefixes
    3. OutputA report per cookie and a corrected header

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Securing logins and checking consent cookies.

    By the numbers

    Failed checks per sample cookiesession: fails: 3; __Host-csrf: fails: 0; theme: fails: 0; tracking id: fails: 3session: fails3__Host-csrf: fails0theme: fails0tracking id: fails3
    Checked by this tool's own rules: Secure, HttpOnly, SameSite, the __Host- and __Secure- prefixes, Domain scope and lifetime. __Host-csrf passes everything, which is the pattern to copy for session cookies. Source: RFC 6265: cookies; MDN: Set-Cookie.
    Show the numbers as a table
    CookieFailWorth fixingPass
    session320
    __Host-csrf004
    theme013
    tracking id320

    How to use it

    1. Paste one or more Set-Cookie headers.
    2. Enter the site's host and whether it's HTTPS.
    3. Read the issues for each cookie.
    4. Copy the corrected headers.

    FAQ

    Which SameSite value should I use?

    Lax for most session cookies. Strict for sensitive actions. None only when a cookie must work in cross-site iframes, and it then needs Secure.

    What does the __Host- prefix do?

    Browsers only accept a __Host- cookie if it's Secure, has Path=/ and no Domain, which stops subdomains overriding it.

    Why is my long expiry shortened?

    Browsers now cap cookie lifetimes at 400 days, whatever Max-Age or Expires says.

    Is anything sent?

    No. The headers are parsed in your browser.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk