跨多个TLD的Cookie? [英] Cookies across multiple TLDs?
本文介绍了跨多个TLD的Cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道如何使Cookie跨子域工作(将 .example.com
设置为域),但是在我的最新项目中,我有多个类似的域:
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
...
是否可以使Cookie在这些域中正常工作?半相关的,我也可以使 localStorage
跨这些域工作吗?
Is it possible to make cookies work across these domains? Semi-related, can I make localStorage
work across these domains too?
推荐答案
Cookie不能那样工作.为了使用cookie,您至少需要具有两个相同的域级别,例如-xyz.example.com和abc.example.com在2个级别上很常见.
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.
这篇关于跨多个TLD的Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文