Understanding Secure, HttpOnly and SameSite Cookie Flags
A cookie flag is a small instruction your website attaches to a cookie that tells the browser how to handle it, and the three that matter most for security are Secure, HttpOnly and SameSite. If our free scan flagged one of them as missing, it means a cookie your site sets is not carrying that instruction, so the browser is treating it more loosely than it could be.
None of the three flags is complicated once you see what each one actually stops. Secure keeps a cookie off plain HTTP, HttpOnly hides it from JavaScript, and SameSite limits when the cookie is sent along with requests that come from other sites. This page explains all three in plain English and, importantly, why a missing flag on a login or session cookie is a bigger deal than the same warning on an analytics cookie.
What the Secure flag does
The Secure flag tells the browser to send a cookie only over an encrypted HTTPS connection, never over plain HTTP. Without it, if any part of your site is ever reached over http:// (an old link, a hardcoded image, a redirect that fires a moment too late) the cookie can travel in clear text where anyone on the same network can read it.
For a session or login cookie this is the difference between a value that stays private and one that could be lifted from public Wi-Fi. Setting Secure is low-risk on a site that already runs fully on HTTPS, because every legitimate request is encrypted anyway, so the flag simply closes the plain-HTTP gap.
What the HttpOnly flag does
HttpOnly tells the browser that a cookie must not be readable by JavaScript running on the page. Normal scripts can reach cookies through document.cookie, and so can malicious script injected through a cross-site scripting flaw. If your session cookie is HttpOnly, that injected script cannot simply read the cookie and send it off to an attacker.
This is the flag that most directly protects a logged-in session. It does not fix the underlying script-injection problem, but it removes the easiest way to steal a session token, which is why a missing HttpOnly on an authentication cookie is worth acting on quickly.
What the SameSite flag does
SameSite controls whether a cookie is sent when a request to your site is triggered from a different site. With SameSite set to Lax or Strict, a form or script on someone else's page cannot quietly make the browser include your cookie in a request to your domain, which is the mechanism behind cross-site request forgery.
Lax is a sensible default for most sites: the cookie still rides along with normal top-level navigation, so users stay logged in when they click through to you, but it is held back on the sneaky cross-site background requests. Strict is tighter and occasionally too tight for links coming from email or other sites, so it suits high-value cookies where a small login friction is acceptable.
Free, instant, no account
See your site's security grade in seconds.
Free, instant, and no account needed to see your grade.
Scan my site freePlain-English A to E grade in about 10 seconds. No account needed to see it.
Why a login cookie matters more than an analytics one
Not every cookie carries the same risk. A cookie that holds your session (the thing that keeps a user logged in) is a key to an account, so Secure, HttpOnly and a sensible SameSite value all matter for it. If that cookie leaks or gets sent where it should not, someone can act as that user.
An analytics or preference cookie, by contrast, usually holds a random visitor ID or a setting like a chosen language. A missing flag there is untidy and still worth fixing, but it is not handing anyone the keys to an account. When you read a cookie-flags warning, look first at what the cookie is for: session and authentication cookies are the ones to prioritise.
What our scan can and cannot see
The free EB Security scan reads the flags on cookies your site sets for an anonymous visitor, the ones handed out on the public pages before anyone logs in. It reports whether each of those cookies carries Secure, HttpOnly and SameSite, and explains any that are missing.
It cannot see cookies that are only set after a user logs in, because it never logs in, and it does not read or audit your session-handling code. So treat a clean result as good news for your public cookies, not as a full review of your authentication. If your login flow sets its own session cookie, check that one directly in your platform or with your developer.
Secure keeps cookies off plain HTTP, HttpOnly hides them from scripts, and SameSite limits cross-site sending. All three matter most on session and login cookies, so fix those first and remember the scan only sees the cookies your site sets before anyone logs in.