Cookie设置为子域,但IE开发工具在根域显示cookie。我缺少什么? [英] Cookie set for subdomain, but IE Developer Tools show cookie at root domain. What am I missing?

查看:226
本文介绍了Cookie设置为子域,但IE开发工具在根域显示cookie。我缺少什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些网站挂在根域上。例如:

  dev.mydomain.co.nz 
test.mydomain.co.nz
www。 mydomain.co.nz

我使用Fiddler监控我与dev.mydomain.co.nz的连接具有标题的Cookie:

  Set-Cookie:mytest = blah; domain = dev.mydomain.co.nz;然后在IE10中,我使用F12开发工具,然后选择缓存 - 查看cookie信息。 

/ p>

显示我:

  NAME mytest 
VALUE blah
DOMAIN mydomain.co.nz
PATH /
EXPIRES在会话结束时

dev子域去哪里?



奇怪的是,如果我请求test.mydomain.co.nz ,它不发送cookie,但发送请求到dev.mydomain.co.nz发送mytest cookie。



资源 - Chrome中的Cookie开发者工具代表cookie完全如我所料。 IE BEHAVES正确地与Chrome类似,但是开发人员工具似乎使会话Cookie细节变得模糊。



这是IE的问题还是我缺少某些东西?

解决方案

IE开发人员工具



参考




We have a number of sites hanging off a root domain. E.g:

dev.mydomain.co.nz
test.mydomain.co.nz
www.mydomain.co.nz

I monitor my connection to dev.mydomain.co.nz with Fiddler and receive a cookie with a header like:

Set-Cookie: mytest=blah; domain=dev.mydomain.co.nz; path=/

Then in IE10 I use F12 Developer Tools, then select Cache - View cookie information.

It shows me this:

NAME  mytest
VALUE  blah
DOMAIN  mydomain.co.nz 
PATH  / 
EXPIRES  At the end of the Session 

Where'd the "dev" subdomain go?

The weird thing is, if I then make request to test.mydomain.co.nz, it does NOT send the cookie, but a request to dev.mydomain.co.nz DOES send the mytest cookie.

The Resources - Cookies developer tool in Chrome represents the cookies exactly as I'd expect. IE BEHAVES correctly like Chrome, but the developer tools seem to garble the session cookie details.

Is this an IE problem or am I missing something?

解决方案

There's no distinction between domains and subdomains in IE Developer Tools.

References

这篇关于Cookie设置为子域,但IE开发工具在根域显示cookie。我缺少什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆