Is it possible to share a cookie between a domain and a subsubdomain

风格不统一 提交于 2019-12-22 04:29:22

问题


I'm trying to share a cookie between www.example.com and admin.other.example.com I've being able to make it work with other.example.com, but there's no way to access the sub-sub-domain

Edit: I handle subdomains by defining the cookie domain as .example.com (note the first dot)


回答1:


You can only share cookies between a domain and its own subdomains. For example:

  • a cookie defined for the domain example.com can be accessed by www.example.com and foo.bar.example.com
  • a cookie defined for the domain www.example.com can be accessed by foo.www.example.com but not by bar.example.com


来源:https://stackoverflow.com/questions/7201493/is-it-possible-to-share-a-cookie-between-a-domain-and-a-subsubdomain

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