Setcookie (' Cookie name ', ' cookie value ');
Setcookie (' Cookie name ', ' cookie value ', ' Cookie life cycle '); The third parameter of the Setcookie function is how long the cookie is stored in the browser, which can be used to indicate how many seconds from now to be destroyed, and if the cookie is to be destroyed, the third parameter can be set to 0;
Setcookie (' Cookie name ', ' cookie value ', ' Cookie life cycle ', ' cookie scope '); The meaning of the fourth parameter of the Setcookie function is to indicate which path range the cookie can be obtained, such as Setcookie (' key ', ' value ', Time () +10, '/') This cookie is set to be created at the root of the site, so it can be retrieved throughout the site;
Setcookie (' Cookie name ', ' cookie value ', ' Cookie life cycle ', ' cookie scope ', ' Domain name '), here The fifth parameter is also a scope, such as can be set to ' baidu.com ' Indicates that the cookie can be obtained on all pages under the Baidu website;
On the meaning of the parameters of the Setcookie function