How to fix: Cookie Set Multiple Times With Different Paths
The same cookie name is set more than once in the response, each with a different Path attribute.
Why it matters
The browser stores both cookies simultaneously and sends whichever one matches the current request path, so server-side code reading a single 'the' value for that name can silently read stale or unintended data.
Cookies are keyed by (name, domain, path) as a tuple, not by name alone. Setting 'session' at Path=/ and again at Path=/app creates two independent cookies that both appear as 'session' in document.cookie on paths under /app, and which one wins depends on cookie ordering rules that vary by browser.
How to fix it
- 1Use a single, consistent Path (usually /) for each cookie name across the whole application.
- 2If you need path-scoped cookies, give them distinct names instead of relying on Path to disambiguate.
Code examples
Use one Path per cookie name
Set-Cookie: session=abc123; Path=/; Secure; HttpOnly; SameSite=LaxReferences
Detected automatically by VulnRadar. The check id is cookie-duplicate-name-different-path, stable across every scan so you can filter or diff on it.
More cookies checks
- LowCookie Domain Attribute Is Too Broad
- LowCookie Missing Secure Attribute
- InfoThird-Party Cookie Missing Partitioned Attribute
- High__Host- Prefix Cookie Missing Secure Attribute
- High__Host- Prefix Cookie with Non-Root Path
- High__Secure- Prefix Cookie Missing Secure Attribute
- LowCookie Expires/Max-Age Exceeds 1 Year
- InfoCookie Name Leaks Framework or Language
Questions
- How severe is Cookie Set Multiple Times With Different Paths?
- VulnRadar rates this low severity in the cookies category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id cookie-duplicate-name-different-path, which stays the same between runs so you can filter, diff, or gate CI on it.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.