__Host- prefix

A cookie name prefix that the browser only accepts if the cookie is Secure, has Path=/ and names no domain, so subdomains cannot overwrite it.

In more detail

Because the cookie is locked to the exact host that set it over HTTPS, a compromised or malicious subdomain cannot plant a fake session cookie on the main site. Browsers enforce the rules, so the server gets them for free by choosing the name.

Example

Set-Cookie: __Host-sess=tok_xyz; Path=/; Max-Age=3600; HttpOnly; Secure; SameSite=Strict

Related terms

Taught in

References