Properties of the cookie
Domain: Domains, that is, the scope of the cookie can be used, of course, the current domain can be under the current domain cookie, and one is the domain name of the parent domain name (the child domain name is access to the parent domain name under the cookie, A parent domain name is a cookie that cannot be accessed without processing a child domain name)
Path: This parameter also controls the access of the cookie, if the current path=/admin/welcome/path, when you access the same domain name under the/admin/goout/path of the page you are not accessible, so generally we will be set to Path= "/", This allows us to access this cookie under the entire domain name and has not encountered a different path.
Maxage:cookie the effective time, not set, the effective time will be closed with the browser to expire, set the words will of course live according to your requirements. Delete a cookie to set the cookie's validity period: Current time-1, now it's dead.
Attention:
1, Request.getcookies () may return a null value.
2. New cookie The default path is to create his request path, which is not available in other paths. If you want to use this cookie throughout your site, you need to manually specify path using Cookie.setpath (). such as: Cookie.setpath ("/petstore").
3. Accessing the same server with the domain name using the IP address will create different cookies.
About the use of cookies