Secure, HttpOnly, SameSite: check your session cookie flags in 30 seconds
By Abbi Labs · Last updated 20 November 2026
Built with Lovable, Bolt, Cursor or Replit?
The Abbi Labs quick check reads the cookies your home page, /login and /api/auth/session set, and flags login cookies missing Secure or HttpOnly and SameSite=None without Secure. Cookie values are never stored. No sign-up for the quick check.
No app handy?
No sign-up. Read-only public-resource and protocol metadata checks. No model prompts or tool execution. Scan only sites you own or are allowed to test.
Run on every deploy or use from Cursor / Claude Code via MCP →
What the flags do
- Secure: the cookie is only sent over HTTPS. Without it, the browser also sends it over plain
http://, where anyone on the same Wi-Fi can read it. - HttpOnly: JavaScript can't read it. Without it, one XSS bug or a compromised third-party script can copy
document.cookieand take over the session. - SameSite=Lax (or Strict): the cookie isn't sent on most cross-site requests, which blocks classic CSRF.
SameSite=Nonemust always come withSecure, or browsers drop the cookie.
Check yours
In Chrome: DevTools → Application → Cookies → your domain. Your login/session cookie should have the Secure and HttpOnly columns ticked. Or from a terminal:
curl -s -D - -o /dev/null https://yourapp.com/login | grep -i set-cookieThe fix
// Next.js (route handler / server action)
cookies().set("session", value, { httpOnly: true, secure: true, sameSite: "lax", path: "/" });
// Express / express-session
app.use(session({ cookie: { httpOnly: true, secure: true, sameSite: "lax" }, /* ... */ }));
res.cookie("session", value, { httpOnly: true, secure: true, sameSite: "lax" });
// Best: the __Host- prefix (requires Secure, Path=/ and no Domain)
Set-Cookie: __Host-session=...; Path=/; Secure; HttpOnly; SameSite=Lax- NextAuth/Auth.js and Clerk set these flags for you in production. If yours are missing, check for custom
cookiesoptions or a site served over http. - Supabase:
@supabase/ssrkeeps itssb-…-auth-tokencookie readable by JavaScript by default so the browser client can use it. Abbi Labs reports that as low, not a bug. Make sure it is Secure, and keep XSS out (CSP, nodangerouslySetInnerHTMLwith user input). - CSRF tokens used for double-submit and analytics cookies (
_ga,_fbp) are meant to be readable; they don't need HttpOnly.
Fix it with AI
Paste this into Lovable, Bolt, Cursor or Replit:
My site sets a login/session cookie without the right flags. Find every place cookies are set (cookies().set, res.cookie, Set-Cookie headers, NextAuth/Auth.js cookie options, express-session, @supabase/ssr cookieOptions). For session cookies set Secure: true, HttpOnly: true, SameSite: "lax" and Path: "/" (use the __Host- prefix if possible). Use SameSite "none" only with Secure. If my frontend reads the session cookie with document.cookie, move that to a server endpoint. Leave CSRF double-submit and analytics cookies readable. Don't change cookie names or values. Show me how to verify in DevTools → Application → Cookies.Keep it that way
Cookie options get dropped when you swap auth libraries or add a custom login route. Abbi Labs re-scans your live app and alerts you when something changes: leaked keys, readable Supabase tables, exposed files, CORS, cookie flags and certificate expiry.
FAQ
Which cookies does Abbi Labs treat as session cookies?
Ones whose name looks like a login or session (session, sid, auth, token, jwt, next-auth, connect.sid, sb-…-auth-token and similar). Judged by name only, so the finding is marked likely. Missing Secure or HttpOnly on those is medium; other first-party cookies missing Secure are low.
Are Google Analytics or Facebook cookies flagged?
Only if they use SameSite=None without Secure (which browsers reject anyway), and then as low. They are set and read by the vendor's script by design.
Do I need Secure if my site redirects http to https?
Yes. The first request a browser makes to http://yourdomain still carries a non-Secure cookie before the redirect. HSTS plus Secure closes that gap.
What exactly does the check request?
Normal GETs to your home page (following same-site redirects), /login and /api/auth/session, the same requests a visitor's browser makes. It reads the Set-Cookie responses and keeps only cookie names and flags, never values.