Fix guide · Web application · low
Cookies missing Secure or HttpOnly
Session cookies without the Secure flag can be sent over plain HTTP and read on the network. Without HttpOnly, any script on the page, including an injected one, can read them and hijack the session.
Time to fix
10 minutes
Risk if ignored
Session hijacking
Breaks anything?
Rarely: only scripts that read the cookie on purpose
How to fix it
In php.ini (or before session_start()):
session.cookie_secure = 1
session.cookie_httponly = 1
session.cookie_samesite = "Lax"For cookies you set yourself: setcookie($name, $value, ['secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
The scan result lists the exact cookie names that are missing a flag.
Check your fix
Common mistakes
- Setting Secure on a site that still serves some pages over HTTP, so the cookie disappears there.
- Setting HttpOnly on a cookie your own JavaScript needs to read (keep those non-sensitive).