(1) The validity period of a cookie:
Default: The end of the session cycle (that is, the browser is off), by default, the cookie will expire when the browser is closed, which is a temporary cookie or a session.
Support set the validity period, the third parameter of Setcookie, can set the validity period of the cookie, and the validity period is represented by a timestamp. (This is set for 60 seconds, but the cookie expires in a minute regardless of whether the browser is off)
So who's to judge if this cookie is invalid or ineffective? is the browser, when the server sets a cookie, and also tells the browser ' I ' currently sends a cookie that expires in 60 seconds.
(2) Special syntax:
(3) Valid path to cookies:
The cookie is valid in the current directory and in the descendant directory, as long as it is not recognized in the directory above his current directory.
So, I just set this cookie in my root directory, so it works for the whole station.
In this php34 directory, I set the value of the cookie in cookie_1.php, which can be accessed in cookie_2.php, while in kang/cookie_kang_1.php and Kang/cookie_kang_2. PHP can also be accessed,
However, if I set the value of the cookie in kang/cookie_kang_1.php or kang/cookie_kang_2.php, then the cookie_1.php or cookie_2.php outside will not be able to access it.
(This is about the effective path of the cookie)
The request is not related to the local disk path, and it has something to do with your URL (no, it's too esoteric).
Re-hardening: Require is to copy files intact to this location,
Php,cookie) Details of the properties and validity period