If I set document.domain to be "domain.com" in both "www.domain.com" and "example.domain.com", will setting cookies in one of them will affect cookies of the other? Will their cookies be seen to each other?
Asked
Active
Viewed 257 times
1 Answers
2
Cookies can only be seen by the domain they're set by when you have not specified the domain. If you set the domain to "domain.com" it will work in "domain.com" and any and all subdomains.
Also, possible duplicate from this
-
I've edited the question. My apologies. So, will adding to the pages under www.domain.com and example.domain.com change in any way cookie access and setting policy between them? – Nazerke Oct 01 '15 at 09:46
-
I don't think this will produce the wanted result, i would stick with setting the cookie with domain specified instead. PHP cookies are read server-side, no js can affect that. – x13 Oct 01 '15 at 09:49