HTTPS & cookies
Three cookie attributes limit how a cookie can be used: Secure (HTTPS only), HttpOnly (hidden from JavaScript) and SameSite (limits cross-site sending).
Not sure whether your site has this problem? Check it in seconds.
Session and login cookies are what attackers want. HttpOnly keeps them away from injected scripts, Secure keeps them off unencrypted connections, and SameSite reduces cross-site request forgery. Not every cookie needs all three, for example a theme preference doesn't need HttpOnly.
DevTools → Application → Cookies shows each cookie's flags. Note that our scanner can only see cookies your server sets on the page it fetched.
Raw header
Set-Cookie: session=abc123; Path=/; Secure; HttpOnly; SameSite=LaxExpress
res.cookie('session', token, { httpOnly: true, secure: true, sameSite: 'lax' });Next.js (route handler)
import { cookies } from 'next/headers';
(await cookies()).set('session', token, { httpOnly: true, secure: true, sameSite: 'lax', path: '/' });PHP
setcookie('session', $token, ['secure' => true, 'httponly' => true, 'samesite' => 'Lax', 'path' => '/']);Anything that authenticates a user (session IDs, tokens) and doesn't need to be read by your own front-end JavaScript.
Guidance is general. Test header and DNS changes on a staging copy first, and check your hosting provider's documentation for platform-specific steps.