3 ms·
Nobody mentions it in the Stack Overflow conversation, but if you set cookies for domain.com, they will be shared with all the subdomains (e.g., www.domain.com,
by marklubi 4y ago
Nobody mentions it in the Stack Overflow conversation, but if you set cookies for domain.com, they will be shared with all the subdomains (e.g., www.domain.com, admin.domain.com, etc.).
This can be a good or bad thing depending on how you want things to work and what your security profile is.
I tend towards using www, since cookies set there won't automatically propagate to all subdomains. More restrictive for better baseline security.