开发者

setting cookie with domain

开发者 https://www.devze.com 2023-02-08 13:51 出处:网络
This is pretty much a basic question since I got 开发者_运维知识库a bit confused When we set a cookie with domain .mydomain.com refers to use the same cookie over subdomains, what if I do .test.mydom

This is pretty much a basic question since I got 开发者_运维知识库a bit confused

When we set a cookie with domain .mydomain.com refers to use the same cookie over subdomains, what if I do .test.mydomain.com does it mean urls like helloworld.test.mydomain.com will be able to re-use the cookie?


Yes, that's how it works. There's no special detection of what level the 'subdomains' are, everything is really a subdomain to the TLD at the least. What if you had a .co.uk address?


Here is an intersting article about sharing cookies across subdomains

15Seconds

0

精彩评论

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