Tools / Cookie security
Cookie security checker
Inspect the Set-Cookie attributes returned by a public page. Cookie values are never displayed in the result.
More free checks
Run a full security scan or speed test on your site, or try a related tool.
Related free tools
Attributes checked
Securelimits transmission to HTTPS.HttpOnlyprevents access through browser script APIs where appropriate.SameSitecontrols when browsers attach cookies to cross-site requests.__Host-cookie prefix requirements are checked when used.
Only cookies set by one unauthenticated GET are visible. A cookie's correct settings depend on its purpose and the application flow.
What each attribute actually stops
The three main attributes defend against three different attacks, and setting one does nothing for the others:
HttpOnly— theft via XSS. The cookie becomes invisible todocument.cookie, so injected script cannot read the session token and send it away. It does not stop that script from making authenticated requests as the user: the browser still attaches the cookie. HttpOnly limits exfiltration, not abuse.Secure— interception over plaintext. The cookie is withheld fromhttp://requests. Worth setting even on an HTTPS-only site, because a single accidental HTTP link, a typed address or a stale bookmark is enough to leak a session token to the network.SameSite— cross-site request forgery. Controls whether the cookie rides along on requests triggered by other sites.
Choosing a SameSite value
Strict— never sent on any cross-site request. Strongest, with a visible cost: following a link from an email or another site lands the user logged out until they navigate again.Lax— sent on top-level navigations that use a safe method, withheld from cross-site POSTs, iframes, images andfetch. This is the default browsers now apply when the attribute is absent, and it is the right answer for most session cookies.None— always sent, and requiresSecure. Browsers rejectSameSite=Nonewithout it, so a cookie meant for a third-party embed silently stops working. Only use it for a cookie that genuinely has to cross sites.
Two caveats worth knowing. Lax still permits cross-site GET navigations,
so any state-changing endpoint reachable by GET remains forgeable — another reason not
to mutate state on GET. And because Lax-by-default is browser behaviour rather
than something you declared, relying on it means relying on the user's browser version; set
the attribute explicitly.
SameSite is not a complete CSRF defence
It is a strong mitigation, not a replacement for anti-CSRF tokens. It does nothing against a
same-site attacker — a vulnerable or user-controlled subdomain counts as same-site, since
SameSite is scoped to the registrable domain rather than the origin. An XSS
anywhere under your domain is unaffected by it. Keep tokens on state-changing endpoints and
treat SameSite as defence in depth.
Cookie prefixes: __Host- and __Secure-
Prefixes move guarantees from policy into something the browser enforces for you, which is why they are a genuine upgrade rather than a convention:
__Secure-requiresSecureand an HTTPS origin.__Host-requiresSecure, requiresPath=/, and forbidsDomain. That last part is the valuable one: without aDomainattribute the cookie is locked to the exact host that set it, so a compromised or hostile sibling subdomain cannot overwrite it.
Cookie-overwriting ("cookie tossing") from a subdomain is an underrated attack, and
__Host- is the cheapest defence against it. If a cookie does not need to be
shared across subdomains, prefix it.
Scope, lifetime and the rest
Domain. Omit it. SettingDomain=example.comwidens the cookie to every subdomain, including ones you have forgotten about. Omitting it keeps the cookie host-only.Path. Weak isolation at best — the same-origin policy does not separate paths, so treat it as tidiness rather than security.- Lifetime. A session cookie with no
ExpiresorMax-Agedies with the browser session. Long-lived authentication cookies need server-side invalidation: rotate the identifier on login and privilege change, and make logout actually revoke it server-side rather than just clearing the cookie.
Reading your result
This check sees only the cookies set by a single unauthenticated GET, which on
most sites means consent, analytics and load-balancer cookies rather than the session cookie
that appears after login. A missing HttpOnly on an analytics cookie read by
design from script is not a finding; the same gap on a session token is. Values are never
displayed or stored.
Related checks: security headers analyzer and CORS policy checker. For session handling behind a login, we test authentication and session management end to end.
Frequently asked questions
Which SameSite value should I use for a session cookie?
Lax suits most login sessions: the cookie is sent when someone follows a link to your site, but not on cross-site form posts or background requests. Use Strict for high-value actions such as banking, and None; Secure only when the cookie must work inside another site, such as an embedded widget.
Why does the checker not show my login cookie?
It makes one request as a visitor who is not signed in, so it only sees cookies set on that first page load. Session cookies issued after login need checking in your browser’s DevTools (Application → Cookies) while signed in.
What is the __Host- cookie prefix?
A cookie named __Host-something is accepted by the browser only if it has Secure, Path=/ and no Domain attribute. That locks it to the exact host, so a compromised subdomain cannot overwrite it.
Can the checker see my cookie values?
Values are not shown in the report. It lists each cookie’s name and attributes, which is all you need to fix the configuration.