Security

Cookies are only sent over an encrypted connection

security.cookies-not-secure

Why this matters

A cookie without the Secure flag is sent over a plain, unencrypted connection as readily as over an encrypted one. Anyone sharing a network with the visitor — a café, a hotel, an office guest network — can read it, and a single request to the http version of the site is enough to expose it, even when every page normally redirects to https. The flag costs nothing and there is no reason for a cookie on a secure site to be missing it.

Who fixes it

A developer

Roughly how long

30 minutes

Care needed

Low risk to change

How to fix it

Add `Secure` wherever the cookie is set. In PHP that is the `secure` option on `session_set_cookie_params`; in Express it is `cookie: { secure: true }`; in WordPress most of it comes free from setting the site address to https. A reverse proxy can also rewrite Set-Cookie headers if the application cannot be changed.

How we score it

Failing this check takes up to 12 points off your security score. It is a fact about your site rather than a measurement, so it reads the same on every scan until you change something.

Does your site pass this one?

This check runs on every scan, along with the other 106. Free, no account, and you see the evidence for each result.

Check my site

Other security checks

See all 107 checks