我查阅了很多有关cookies的问题,但在我的问题上没有找到答案。我有以下情况:
用户在 example.com 上创建登录并应该得到一个cookie,但只能针对子域名fuu.example.com 。 我生成以下HTTP头部分:
Set-Cookie: name=TestUser; Domain=fuu.example.com; Path=/; secure; HttpOnly
当我向https://fuu.example.com发出请求时,该 cookie 将不会添加到请求中。我想知道是否有可能example.com为fuu.example.com
设置一个 cookie。我知道example.com可以设置一个 cookie 给.example.com
,也可以为所有子域的example.com设置,但这不是我想要的。
如何为子域设置 cookie?我没有在对子域的请求中看到该cookie。
foo1.example.com
和foo2.example.com
之间共享Cookie怎么样?这是否可能在foo3.example.com
没有获取的情况下实现? - Dushyant Bangalfoo2.example.com
或其通配符子域名适用于*.foo2.example.com
的 Cookie。 - Dushyant Bangalfoo1.example.com
和foo2.example.com
上调用 API,并设置它们各自的 cookie。 - Dushyant Bangal.example.com
结尾的,这些网站共享同一个cookie。但是我想要在media.example.com
上排除共享cookie。” - PPBservice.example.com
的服务和一个登录页面在example.com
。然后,在用户登录时在example.com
设置一个cookie,我将能够从service.example.com
使用该cookie。这样可以吗?您可以理解我没有其他程序使用example.com
认证服务器。 - RealZombs