Fix · Express / Node
Fix “Cookie hygiene” on Express / Node
Set every session cookie with: HttpOnly; Secure; SameSite=Lax
res.cookie('sid', value, { httpOnly: true, secure: true, sameSite: 'lax' });
Verify the fix
Re-run the Cookie hygiene check after deploying. Test config changes in staging first and keep a rollback: a wrong header can break a site faster than a missing one.
Other stacks: nginx · Apache · Caddy · Cloudflare