Loading…
Add the flags that stop cookies being stolen over HTTP, via XSS, or in CSRF attacks.
A session cookie without the right flags can be sent over plain HTTP (Secure fixes this), read by JavaScript in an XSS attack (HttpOnly fixes this), or sent on cross-site requests in CSRF (SameSite fixes this). Auth cookies should always set all three.
Secure, HttpOnly and SameSite on session/auth cookies.Lax for most cookies; Strict for the most sensitive; None; Secure only when a cookie must cross sites.Set-Cookie: session=abc123Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=Lax; Path=/WordPress sets sensible auth-cookie flags on HTTPS; review custom cookies set by plugins or theme code.
Set secure, httpOnly, sameSite in cookies().set() options.
Run a free audit and get a prioritized fix list with auto-generated code.
Run a free audit