问题
I know how to make a cookie work across subdomains (set .example.com as the domain), but on my latest project I have multiple domains like so:
example.co.uk
example.net
example.biz
...
Is it possible to make cookies work across these domains? Semi-related, can I make localStorage work across these domains too?
回答1:
Cookies don't work that way. You would need to have at least two levels of the domain to be the same in order to use cookies eg- xyz.example.com and abc.example.com are common at 2 levels.
来源:https://stackoverflow.com/questions/15391241/cookies-across-multiple-tlds