The cookie is valid and cannot be executed normally. Please take a look at the file directory structure login interface and the main file in the root directory, other files in the main folder, $ name zhang San; setcookie (F_user, $ name, time () + 900); print_r ($ _ COOKIE); you can get F_user zhangsan normally, but it is running and exits in less than 900 seconds. Later
The cookie is valid and cannot be executed normally. Please take a look at the file directory structure login interface and the main file in the root directory, other files in the main folder, $ name = "Zhang San "; setcookie ("F_user", $ name, time () + 900); print_r ($ _ COOKIE); F_user zhangsan is running normally, the system exits in less than 900 seconds. Later
The cookie is valid and cannot be executed normally. Take a look.
The file directory structure login interface and the main file are in the root directory, and other files are in the main folder,
$ Name = "James ";
Setcookie ("F_user", $ name, time () + 900 );
Print_r ($ _ COOKIE); F_user> John
However, the system exits in less than 900 seconds.
Later, Baidu found that the path should be added to the cookie, so it changed
Setcookie ("F_user", $ name, time () + 900 ,"/");
This way, print_r ($ _ COOKIE [this article from the Internet (http://www.68idc.cn)]); get F_user> null, do not get the cookie value, resulting in Login Failure
What is the problem?
------ Solution ----------------------
Check whether F_user exists in the cookie option of the browser.
------ Solution ----------------------
No problem in my test