What is the cookie sharing mechanism?

cookie is shared across ports?
what about different subdomains? For example, I have a.test.com and b.test.com , and I can also get cookie and b.test.com in the a.test.com setting. Empty it?


demain is set to primary domain .com (codeshelper.com), then different subdomains can be obtained.


cookie there is something called domain


https://blog.csdn.net/zhouziy.


There are two types of sharing of

cookie: path and domain

path (directory sharing) a.com/a | a.com/b
domain (subdomain name sharing) a.a.com | b.a.com

Menu