Secure Cookie Test |
What Makes a Cookie Secure?
A secure cookie has the Secure flag (sent over HTTPS only), HttpOnly (hidden from JavaScript) and a SameSite policy (limits cross-site sending). This test reads every cookie a website sets, on each redirect, and flags what's missing.
Each result shows the flags, the lifetime and scope, the response that set the cookie, and a plain line on what a missing flag risks. Cookies whose names look like sessions or logins (they contain "sess", "auth", "token" and similar) are judged more strictly, because stealing them means taking over an account.
What Is an HttpOnly Cookie?
HttpOnly hides a cookie from JavaScript, so an XSS attack can't read session cookies. Set it on every session and auth cookie.
Without it, any script on the page can read document.cookie, including a script injected through a cross-site scripting bug, which can send the session token to an attacker. Leave HttpOnly off only for cookies your own scripts must read, such as a consent choice or a theme preference, and never put secrets in those.
What Does the Secure Flag Do?
Secure cookies are only sent over HTTPS, so they can't leak on an unencrypted connection.
Without Secure, the browser also sends the cookie to http:// addresses on the same site, for example when someone types the address without https, where anyone on the network can read it. Browsers ignore a Secure cookie set by a plain HTTP response, so set cookies only after redirecting to HTTPS, and add HSTS so browsers skip the HTTP step entirely.
SameSite: Strict, Lax or None?
Lax blocks most cross-site sending and is Chrome's default when the attribute is missing; Strict blocks all of it; None allows it and requires Secure.
| SameSite | Same-site requests | Following a link from another site | Cross-site images, frames, fetch and form posts |
|---|---|---|---|
Strict | Sent | Not sent | Not sent |
Lax | Sent | Sent | Not sent |
None (with Secure) | Sent | Sent | Sent |
| Not set | Sent | Sent | Chrome and Edge: not sent (treated as Lax). Firefox and Safari: sent. |
Lax suits most session cookies; Strict suits sensitive actions where arriving logged out from a link is acceptable. SameSite reduces cross-site request forgery (CSRF) but isn't a complete defence: subdomains of the same site count as "same site", so keep CSRF tokens on forms that change data.
Cookie Prefixes and Partitioned Cookies
__Host- cookies must be Secure, Path=/ and host-only; Partitioned (CHIPS) cookies are kept separately for each top-level site.
__Host-: the browser accepts the cookie only with Secure,Path=/and no Domain, so no subdomain and no plain-HTTP page can overwrite it. It's the safest name for a session cookie.__Secure-: the browser accepts the cookie only with Secure.Domain=example.com: the cookie is also sent to every subdomain. Without Domain, it stays on the exact host that set it.Partitioned: for third-party cookies, such as an embedded chat widget. The cookie is stored separately for each site that embeds it, so it can't track you across sites. It requires Secure.
How to Fix Insecure Cookies
Set the three flags where your framework creates the session cookie, or add them at the proxy for cookies you don't control.
| Where | Setting |
|---|---|
| Spring Boot | |
| Express (Node.js) | |
| PHP (php.ini) | |
| Django | |
| Nginx (proxy) | |
For a session cookie, the strongest setup is __Host- name, Secure, HttpOnly, SameSite=Lax, Path=/ and no Domain. After deploying, run the test again.
How This Test Works
| Item | Detail |
|---|---|
| Request | A GET to the URL you enter (https:// by default), following up to 5 redirects, each checked to be a public address. 8-second timeout per step. |
| What it reads | Every Set-Cookie header on every response, up to 100 cookies. Cookie values aren't kept or shown. |
| Checks | Secure, HttpOnly, SameSite, the __Host- and __Secure- prefix rules, Partitioned, Domain and Path, Expires and Max-Age (with the 400-day cap) and the 4,096-byte limit. |
| Limits | Only cookies the server sets: cookies created by JavaScript, and cookies that need a login or a form submission, aren't seen. |
| Stored | Nothing. Shared result links aren't indexed by search engines. |
| Last verified | 10 November 2026 |
Frequently Asked Questions
How do I check a website's cookies?
What is an HttpOnly cookie?
What does SameSite=Lax mean?
Why does a site set cookies before I accept the banner?
Why doesn't the test show all the cookies I see in my browser?
How long can a cookie last?
Next steps