BOOL Setcookie (string name [, string value [, int expire [, String path [, string domain [, bool secure]]])
1. Six elements
Name, value, timeout, cookie valid website path, cookie domain name, cookie send security
2. Three points of attention
(1) path
Cookies are valid only within the path directory and its subdirectories.
If path is set to "/", valid throughout the site, if set to "/news/", it is only valid in the news directory and its subdirectories
(2) domain
This parameter should be set to '. example.com ' for the cookie to be valid for all subdomains under the example.com domain name. Although. Not necessary, but plus it will be compatible with more browsers. If the parameter is set to example.com, it is only valid in the primary domain and access to the sub-domain name does not take the cookie.
(3) cookie with the same name
The signature of the cookie is name and domain.
PHP's Setcookie () function