开发者

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

开发者 https://www.devze.com 2023-03-30 18:04 出处:网络
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

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 开发者_Python百科by defining the cookie domain as .example.com (note the first dot)


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
0

精彩评论

暂无评论...
验证码 换一张
取 消