Abbi Labs

Guides

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

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-cookie

The 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

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.

Run a free scan

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.

Related

Weekly AI-app security checklist

One short email a week: a practical check for apps built with Supabase, Next.js and AI tools (RLS, leaked keys, headers and more). Unsubscribe anytime.