Cookie flag simulator
Six Set-Cookie headers, six kinds of request. See which cookies the browser sends, which scripts can read, and which it rejects outright.
Goal
After sign-in, https://app.contoso.example/login answered with six Set-Cookie headers. Choose a request and see which cookies the browser attaches, then check which ones a script on the page could read.
Domain, Path, Secure, HttpOnly, and SameSite each remove a cookie from some situations. The reason column names the rule that decided.
Question
Request
Set-Cookie: session=9f2c41e8; Path=/; Secure; HttpOnly; SameSite=Lax Set-Cookie: csrf=Qm4t7Zp1; Path=/; Secure; SameSite=Strict Set-Cookie: theme=dark; Path=/ Set-Cookie: tracker=a81f; Path=/; SameSite=None Set-Cookie: sso=ZXhhbXBsZQ; Domain=contoso.example; Path=/; Secure; HttpOnly; SameSite=Lax Set-Cookie: admin_pref=compact; Path=/admin; Secure
| Cookie | Sent | Why |
|---|---|---|
session | yes | Same-site request that matches domain, path, and scheme. |
csrf | yes | Same-site request that matches domain, path, and scheme. |
theme | yes | Same-site request that matches domain, path, and scheme. |
tracker | rejected | SameSite=None requires Secure, so the browser drops this cookie. |
sso | yes | Same-site request that matches domain, path, and scheme. |
admin_pref | no | Path /api/profile is outside /admin. |
Cookie: session=9f2c41e8; csrf=Qm4t7Zp1; theme=dark; sso=ZXhhbXBsZQ
Steps
01Which cookie does the browser refuse to store?
02The hidden form on evil.example posts to /transfer. Does the session cookie go with it?
03Following a link from news.example, which cookie stays behind that a same-site request would include?
04Which cookies can a script on https://app.contoso.example/ read through document.cookie?
05Which cookie also reaches blog.contoso.example?