pentesting, updated
Testing for cookies attributes
Confirm session cookies carry the attributes that stop them being stolen or sent somewhere they shouldn't be.
Goal
Verify every session cookie sets Secure, HttpOnly and an appropriate SameSite.
How to test
curl -sI https://example.com/login -d "user=test&pass=test" | grep -i set-cookie
Expect something close to:
Set-Cookie: session=...; Secure; HttpOnly; SameSite=Strict; Path=/
What to look for
HttpOnly missing (cookie readable by JS, so XSS steals it directly), Secure missing (sent over HTTP), or SameSite=None without a real cross-site need.
References
- OWASP WSTG-SESS-02 — Testing for Cookies Attributes.