Cookie set for subdomain, but IE Developer Tools show cookie at root domain. What am I missing?

≡放荡痞女 提交于 2019-12-23 10:26:17

问题


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?


回答1:


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

References

  • IE Cookie Internals
  • Update to Internet Explorer's Cookie Jar



回答2:


I had a problem vers Domain was localhost or when domain didn't contain TLD.

For IE your domain should have a valid TLD, or leave Domain empty



来源:https://stackoverflow.com/questions/16804278/cookie-set-for-subdomain-but-ie-developer-tools-show-cookie-at-root-domain-wha

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!