Free tool · no signup

Cookie security checker

Paste the Set-Cookie headers your site sends and see which cookies are missing Secure, HttpOnly or SameSite, with a plain-English fix for each. Everything is read in your browser.

By the Bug Circuit security team · Last updated

How do I secure a cookie? Set three attributes on every session or login cookie: Secure (https only), HttpOnly (not readable by scripts) and SameSite=Lax or Strict (not sent on cross-site requests). The checker tells you which of your cookies are missing them.

How it works

The flags that matter

Secure means the browser only sends the cookie over https. Without it, anyone on the same Wi-Fi network can read the cookie the moment the browser makes a plain http request. HttpOnly hides the cookie from JavaScript, so a cross-site scripting bug cannot simply read your session. SameSite controls whether the cookie is sent when another site triggers a request to yours, which is the mechanism behind cross-site request forgery.

A session cookie with all three is the baseline. A cookie that identifies a logged-in user without them is a high-severity finding in most security tests.

Prefixes and scope

Naming a cookie with the __Host- prefix makes the browser enforce a strict shape: it must be Secure, have Path=/ and must not have a Domain attribute. That binds it to your exact host and stops a subdomain, or an attacker who controls one, from overwriting it. __Secure- only requires Secure. A Domain attribute shares the cookie with every subdomain, including ones you may have forgotten.

Lifetime matters too. Browsers such as Chrome limit cookie lifetimes to about 400 days, and a login cookie that lives for a year is useful to a thief for a year.

Where to get the headers

Open your site, open the browser developer tools, go to the Network tab, reload, click the first request and copy each Set-Cookie line from the response headers. Paste one per line. The checker flags session-like names (session, token, auth, sid and so on) more strictly than other cookies.

Worked examples

A risky session cookie

A login cookie with no flags.

Set-Cookie: sessionid=9f8e7d6c5b4a; Path=/

Two high findings: missing Secure and missing HttpOnly, plus no SameSite. Anyone on the network or any injected script can read it.

A well-set cookie

The strongest scope.

Set-Cookie: __Host-session=abc123; Path=/; Secure; HttpOnly; SameSite=Lax

Passes. Host-only, https only, hidden from scripts and not sent on cross-site requests.

SameSite=None without Secure

A cookie meant for use inside a third-party widget.

Set-Cookie: widget=1; SameSite=None

Browsers reject this cookie. SameSite=None must be paired with Secure.

Frequently asked questions

What does the HttpOnly flag do?
It stops JavaScript from reading the cookie. If an attacker injects a script into your page, they cannot use document.cookie to steal a session that is marked HttpOnly.
What is SameSite and which value should I use?
SameSite decides whether the browser sends the cookie on requests started by other sites. Lax is the right default for most cookies, Strict for sensitive ones, and None only when a third-party context really needs it (and then it must also be Secure).
Do all cookies need these flags?
Session, login and anything that identifies a user do. A harmless preference cookie, such as a theme, matters less, though Secure and SameSite are still good habits. Cookies read by your own front-end script cannot be HttpOnly.
What is the __Host- prefix?
A cookie name prefix that makes the browser enforce Secure, Path=/ and no Domain attribute. It is the strongest way to scope a cookie to your exact host.
Why is a JWT in a cookie flagged?
A token that proves who a user is should be in an HttpOnly cookie. If scripts can read it, a single XSS bug lets an attacker steal it and act as the user.
Does the checker send my cookies anywhere?
No. Parsing and checking happen in your browser. Still, do not paste live session values into tools you do not trust: you can replace the value with a placeholder, since only the flags matter.

Keep reading

See what attackers see, for free

Run the free passive check on your website. No login, no impact on your site, results in seconds.

Ready for the full manual audit? See pricing

Cookie Security Checker: Secure, HttpOnly, SameSite · Bug Circuit