Skip to main content

How to fix: __Host- Prefix Cookie with Non-Root Path

__Host- prefixed cookies MUST have Path=/. A __Host- cookie with a non-root path violates the cookie prefix requirements and will be rejected by compliant browsers.

Why it matters

The browser will reject a __Host- cookie with a non-root path. If the application depends on this cookie for session management, users will be unexpectedly logged out.

The __Host- prefix requires Path=/ to prevent the cookie from being scoped to a specific path. This ensures the cookie is usable by every route on the host, which is the security intent of __Host-.

How to fix it

  1. 1Change the Path attribute to Path=/ on any __Host- cookie.

Code examples

Correct __Host- cookie

HTTP
Set-Cookie: __Host-session=abc123; HttpOnly; Secure; SameSite=Lax; Path=/

References

Detected automatically by VulnRadar. The check id is cookie-host-prefix-wrong-path, stable across every scan so you can filter or diff on it.

See every cookies check

Questions

How severe is __Host- Prefix Cookie with Non-Root Path?
VulnRadar rates this high 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-host-prefix-wrong-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.

Propose a checkHow a check is built

Scan your own site for __host- prefix cookie with non-root path

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

__Host- Prefix Cookie with Non-Root Path fix | VulnRadar