Secure Cookie Test

Check every cookie a site sets for Secure, HttpOnly, SameSite and more.

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.

SameSiteSame-site requestsFollowing a link from another siteCross-site images, frames, fetch and form posts
StrictSentNot sentNot sent
LaxSentSentNot sent
None (with Secure)SentSentSent
Not setSentSentChrome 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.

WhereSetting
Spring Boot
server.servlet.session.cookie.secure=true
server.servlet.session.cookie.http-only=true
server.servlet.session.cookie.same-site=lax
Express (Node.js)
res.cookie('sid', value, { secure: true, httpOnly: true, sameSite: 'lax' });
// express-session: cookie: { secure: true, httpOnly: true, sameSite: 'lax' }
PHP (php.ini)
session.cookie_secure = 1
session.cookie_httponly = 1
session.cookie_samesite = "Lax"
Django
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SAMESITE = "Lax"   # HttpOnly is on by default
Nginx (proxy)
proxy_cookie_flags ~ secure httponly samesite=lax;

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

ItemDetail
RequestA 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 readsEvery Set-Cookie header on every response, up to 100 cookies. Cookie values aren't kept or shown.
ChecksSecure, 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.
LimitsOnly cookies the server sets: cookies created by JavaScript, and cookies that need a login or a form submission, aren't seen.
StoredNothing. Shared result links aren't indexed by search engines.
Last verified10 November 2026

Frequently Asked Questions

How do I check a website's cookies?
Enter the site or a full page URL above, such as example.com/login. The test lists every cookie the server sets while loading it, on each redirect, with its flags, lifetime and scope.
What is an HttpOnly cookie?
A cookie that JavaScript can't read. It protects session and login cookies from being stolen through a cross-site scripting (XSS) bug.
What does SameSite=Lax mean?
The cookie is sent on same-site requests and when you follow a link to the site, but not on cross-site subrequests such as images, frames or forms posted from another site.
Why does a site set cookies before I accept the banner?
Some cookies are set by the server on the very first response, before any choice. Strictly necessary ones, such as a session or load-balancer cookie, are allowed; others may break consent rules in the EU and UK.
Why doesn't the test show all the cookies I see in my browser?
It sees the cookies the server sets in its responses. Cookies created by JavaScript after the page loads, such as most analytics and advertising cookies, aren't visible to it.
How long can a cookie last?
As long as its Expires or Max-Age says, but Chrome caps cookie lifetime at 400 days, as the updated cookie standard requires. A cookie with neither is a session cookie, deleted when the browser closes.

Next steps

Related Tools

HTTP Header Checker
See all security headers a site sends, including HSTS after redirects.
SSL Certificate Checker
Expiry, issuer and chain of a site's certificate.
Global Privacy Control Test
Is your browser sending the GPC opt-out signal?
HTTP/2 Test
Check whether a website supports HTTP/2.

Related Guides

Guide Security and Privacy Tools
all our security checks in one place.