When a customer accesses a Web site based on a PHP technology, a cookie can be generated in PHP using the Setcookie function, which is processed to send the cookie to the client and saved in C:\Documents and Settings\ username \ The Cookies directory. A cookie is part of the HTTP header, so the Setcookie function must be called before any content is sent to the browser. This restriction is the same as the header () function (see the head () function for your own reference). When the customer visits the website again, the browser automatically sends the cookie corresponding to the site in the C:\Documents and Settings\ user name \cookies directory to the server, and the server will automatically convert the cookie from the client to a PHP variable. In PHP5, the cookie sent by the client is converted to a global variable. You can read it by $_cookie[' xxx '. My understanding is that the first visit to the site Setcookies is set up to generate a cookie file, the second visit can be brought with the file together to send, will have value, you can not let others generate with the file fly! At least not for now. So it takes two steps to view cookies.
Setcookie (string string
Cookie Cookie Why does it have to be refreshed before it takes effect