Free cookie security check

Check your cookies for Secure, HttpOnly and SameSite

Three small attributes decide how much use a stolen cookie is to an attacker. The free check reads the cookies your site sets on a public page and reports which of the three are missing, in about ten seconds.

Run my free security checkabout 10 seconds, no account needed

This is the quiet corner of website security. Nobody notices cookie attributes until a session gets hijacked, and they are usually a configuration change rather than a development project, which makes them some of the cheapest points on your A to E grade to pick up.

One thing to get out of the way early: this is about cookie security, not cookie consent. If you are looking for a banner and a GDPR audit, that is a different exercise, and we say so plainly below.

What the cookie check reads

When your site answers an ordinary request, it may set cookies in the response. We read those, in the same way any browser does, and report what each one declares.

  • Whether Secure is set, so the cookie is only ever sent over HTTPS.
  • Whether HttpOnly is set, so scripts running on the page cannot read it.
  • Whether SameSite is set, and to what, which governs whether the cookie rides along on requests coming from other sites.
  • Which cookies are set before anyone logs in, which on most CMS sites is where the session cookie already appears.

Cookies are one of about a dozen areas in the same scan, and they sit close to the security headers findings because the two protect against overlapping problems. How it works lists the full set.

What the three attributes do

Each one closes a different route, which is why setting two out of three is not two thirds of the protection.

AttributeWhat it preventsWhat to set
SecureThe cookie being sent over an unencrypted connection, where anyone on the same network can read it. Without it, a single plain HTTP request can leak a live session.On, on every cookie, once the site is properly on HTTPS.
HttpOnlyJavaScript reading the cookie. It is what limits the damage when a cross-site scripting flaw or a compromised third-party script does get onto your pages.On, for every cookie that is not deliberately read by your own front-end code.
SameSiteThe cookie being attached to requests that originate on somebody else's site, which is the mechanism behind cross-site request forgery.Lax as a sensible default. None only where a cookie genuinely must work cross-site, and only alongside Secure.

Secure and HttpOnly are close to free. SameSite occasionally needs thought, because a value of Strict can log people out when they arrive from an external link.

Two entirely different questions get called a cookie check, and mixing them up wastes time.

  • Cookie security, which is this page: are the cookies your site sets protected against being stolen or misused. That is a technical setting, and it is what our scan reads.
  • Cookie consent, which is about UK GDPR and PECR: are you allowed to set a cookie before the visitor agrees, is your banner honest, and does declining actually stop the tracking. That is a legal and design question, and it needs a person rather than a scanner.

A site can have perfect cookie attributes and a non-compliant consent banner, or the reverse. We do not check consent, and we would rather tell you that than let a green result imply you are covered. The ICO publishes clear guidance on the consent side.

Setting the attributes

Where the change belongs depends on what is setting the cookie, and it is usually not your own code.

  • WordPress. Core session and login cookies follow the site address settings, so the first fix is almost always making sure the whole site is on HTTPS and the site URL says so. After that, cookies without the flags usually belong to a plugin, and the plugin is where they are set.
  • PHP applications. The session cookie attributes are configuration rather than code: the secure, HttpOnly and SameSite settings for session cookies can be set in php.ini or at runtime before the session starts.
  • Laravel. The session config file has explicit secure, HTTP-only and SameSite options, and the secure one is often left at its default in production by accident.
  • Behind a proxy or CDN. Apache can append attributes to outgoing Set-Cookie headers with a header directive, and nginx has an equivalent for cookies coming back from an upstream. Useful when the application is not yours to change.
  • Third-party scripts. Analytics, chat widgets and advertising tags set their own cookies and you do not control their attributes. That is worth knowing rather than fighting.

Set Secure first, and only once the site is genuinely all on HTTPS. Setting Secure on a site that still serves anything over plain HTTP is how people accidentally log themselves out of their own admin area.

What the check cannot see

  • It cannot see cookies that are only set after signing in, because the scan never logs in to anything. On most sites the important session cookie appears anyway, but not on all of them.
  • It does not judge whether a cookie should exist at all, which is the consent question above.
  • It does not read cookie contents, and it does not store any cookie your site sets.
  • It cannot tell you whether a SameSite value is right for your site. Strict is stronger and also more disruptive, and that trade-off depends on how people arrive at your pages.

Common questions

What do Secure, HttpOnly and SameSite actually do?

Secure stops the cookie being sent over an unencrypted connection. HttpOnly stops scripts on the page reading it, which contains the damage from a cross-site scripting flaw. SameSite controls whether the cookie is attached to requests started by another website, which is what blunts cross-site request forgery. The longer explanation is here.

Will setting HttpOnly break my site?

Only if your own front-end code reads that cookie with JavaScript, which is rare for session cookies and common for preference cookies such as a chosen theme or a dismissed banner. Session and authentication cookies should have HttpOnly set; a cookie your own scripts genuinely need to read is a reasonable exception.

Is SameSite=Strict better than Lax?

Stronger, yes. Better depends on the site. With Strict, somebody who arrives from an external link, an email or a search result arrives without their cookie, so they appear logged out. For most business websites Lax is the right default, and Strict suits an application people navigate to directly.

Does this check cookie consent or GDPR compliance?

No. It reads the security attributes on the cookies your site sets. Whether you are permitted to set those cookies, and whether your consent banner is lawful under UK GDPR and PECR, is a separate question that a scanner cannot answer honestly.

Why does my site set cookies without any flags?

Usually a plugin, a third-party script or an application default that was never changed. Site-wide HTTPS is the common blocker: a lot of software refuses to mark cookies Secure until it is sure every page is served over HTTPS, so fixing the certificate and redirects often fixes the cookies too.

Do third-party cookies count in my grade?

We report what we see, including cookies set by scripts you have embedded, because a visitor cannot tell the difference. What you can change is which third-party scripts you load, which is worth reviewing occasionally in its own right.

How safe is your website?

A free A to E grade in about 10 seconds. No account needed.

Check my site