The
Domain
attribute controls which domains can access the cookie. By default, this attribute is not set, limiting the cookie to the domain that created it.
Best Practice
-
Don’t set the
Domain
attribute at all.
-
If you chose to set it, set the
Domain
to the current host (e.g., subdomain.temple.edu).
-
Avoid
setting it to a higher-level domain like temple.edu.
-
Doing so would expose the cookie to all subdomains of temple.edu, meaning it would be included in every request to any page, file, or asset across those subdomains. This can lead to unnecessary data leakage and increased load on resources across multiple domains, risking performance issues and potential security breaches.