The Secure attribute tells the browser to send a cookie only over an encrypted HTTPS connection, never over plain HTTP. Add it to every cookie on an HTTPS site — Set-Cookie: sid=…; Secure — so a session token can never be exposed on the network by an accidental or downgraded plain-HTTP request. There is no downside on a site that already serves HTTPS.
For the site owner (plain English)
In plain terms, the Secure flag is a note your site attaches to a cookie that says “only ever send this over the encrypted connection.” The cookie that keeps a user logged in is effectively their identity, so if it can travel unencrypted, someone on the same network could copy it and act as that user. That makes a missing Secure flag on a login or session cookie a genuine issue worth fixing soon — not something to shrug off. The good news is that it is one of the easiest fixes on the web: it is a single setting in whatever runs your site, and on a site that already uses HTTPS there is no downside. Ask your developer to enable secure cookies, then re-check with the tool below.
What the Secure flag does
A cookie marked Secure is attached by the browser only to requests sent over HTTPS. If the same site is ever reached over http:// — a typed URL, an old bookmark, a link in an email, or an attacker forcing a downgrade — the browser simply leaves the cookie out of that request. Without the flag, the cookie rides along in cleartext and anyone on the network path (shared Wi-Fi, a compromised router, an on-path attacker) can read it and replay the session.
This matters even for sites that redirect HTTP to HTTPS, because the first plaintext request is sent before the redirect is received — and that request already carries any non-Secure cookie. The flag closes that window.
Secure, not just the session cookie. A non-sensitive cookie sent in the clear is still a request that can be observed and, combined with other leaks, can aid an attacker. There is no cost to setting it.SameSite=None requires Secure
There is one case where a missing Secure flag is not just a weakness but a functional error: a cookie set with SameSite=None. Modern browsers require that any cookie which opts into cross-site sending also carries Secure. If it doesn't, the browser silently rejects the cookie entirely — so it likely isn't working at all. If you need a cross-site cookie, always pair the two: SameSite=None; Secure.
__Secure- and __Host- depend on it too
The cookie name prefixes build on Secure. A browser only accepts a __Secure- cookie if it carries the Secure flag, and a __Host- cookie must be Secure, set with Path=/, and carry no Domain. Claiming a prefix without meeting its rules is a real bug — the browser rejects the cookie, so the session can break. See the cookie security overview for how the prefixes fit together.
How to add the Secure flag
Set it wherever your application or framework issues the cookie:
# Raw header
Set-Cookie: sid=<token>; Secure; HttpOnly; SameSite=Lax; Path=/// Express
res.cookie("sid", token, { secure: true, httpOnly: true, sameSite: "lax" });
# Django settings.py
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
# Rails config/initializers/session_store.rb
Rails.application.config.session_store :cookie_store, key: "_app_session", secure: true
// PHP
setcookie("sid", $token, ["secure" => true, "httponly" => true, "samesite" => "Lax"]);Behind a CDN or proxy that terminates TLS, make sure your framework still knows the original request was HTTPS (e.g. trust the X-Forwarded-Proto header) — otherwise it may decline to set Secure cookies because it thinks the connection is plain HTTP.
Check whether your cookies set the Secure flag — in seconds, free.
Run the cookie checker →A common gotcha
During local development over http://localhost, Secure cookies are not sent, which can make sessions appear broken. That is expected — gate the flag on your environment so it is on in staging and production (over HTTPS) and relaxed only for local HTTP development. Never ship the relaxed setting to production.
For the full picture, read the cookie security guide, and pair this with HttpOnly and SameSite.