This article mainly analyzes and introduces the path and domain attributes in cookies in detail. If you need them, please refer to them and hope to help you. 1. domain indicates the domain where the cookie is located. The default value is the request address. For example, if the website address is www.jb51.net/test/test.aspx, then domainmask is www.jb51.net. For cross-origin access, if the domain A is t1.test.com and the domain B is t2.test.com, you must set the domain of the cookie to .test.com to generate A cookie that can be accessed by domain A and domain B in domain; to generate A cookie in domain A that makes domain A inaccessible and domain B accessible, set the domain of the cookie to t2.test.com.
2. path indicates the directory where the cookie is located. asp.net is/by default, which is the root directory. The directory on the same server is/test/,/test/cd/,/test/dd/, and the path of cookie1 is/test /, if the path of cookie2 is/test/cd/, all the pages under test can access cookie1, while the subpages of/test/AND/test/dd/cannot access cookie2. This is because the cookie allows the page under its path to access.
3. the browser will save cookies with the same domain and path in one file, and use * to separate cookies.
4. cookie with a value Key-value Pair: Previously, the cookie with a nam = value single key-value pair was used. Once it was said that the cookie with multiple sub-key-value pairs was lost. Now I have figured it out. The cookie format containing multiple child key-value pairs is name = key1 = value1 & key2 = value2. It can be understood that the value of a single key-Value Pair saves a custom multi-key string, where the key-Value Pair Delimiter is &, of course, you can define a separator, however, asp.net is used as the separator.