Use setcookie (& quot; name & quot;, & quot; jinbiao & quot;, time () & #43; 3600) for cookies in PHP) 1. when you access the page for setting cookies, the following data is returned to the client: Set-Cookienamejinbiao; expiresMon, 10-Sep-201209: 47: 09GMT. when the browser obtains this information, PHP uses cookies.
Setcookie ("name", "jinbiao", time () + 3600)
1. when you access the page for setting cookies, the following data will be returned to the client:
Set-Cookie name = jinbiao; expires = Mon, 10-Sep-2012 09:47:09 GMT
After the browser obtains the information, it will keep the cookie value in a specified folder on the client.
2. if the third parameter is not specified, the client will not save the cookie. when the browser is closed, the cookie disappears.
3. cookie can only keep strings
Cookie lifecycle:
If the Expiration time is set for the cookie, such as setcookie ("name", "jinbiao", time () + 3600), the lifecycle is the set expiration time (one hour)
If the expiration time is not set for the cookie, when the execution is similar to setcookie ("name", "jinbiao"), as long as the page is not all closed, the cookie value exists, the cookie expires until all pages are closed.
The same cookie can be obtained on pages of the same site.