Home >Backend Development >PHP Problem >What to do if php cookie is lost
php The cookie is lost because the expiration time is not set. The expiration time is the unix timestamp, and the setting statement is "setcookie('name', 'value', time() 3600);".
Recommended: "PHP Video Tutorial"
Specific questions:
I have a page jump now
setcookie(“name1”,value1); setcookie(“name2”,value2); header(“Location:http:192.168.1.118/b2b2c/qingdao/login);
The problem now is that the value in the cookie cannot be obtained after the jump. May I ask what is the question? Please help experts.
The screen I want to jump to now is a screen in another project.
Solution:
The expiration time is not set, the expiration time is the unix timestamp
~
eg:
setcookie('name', 'value', time()+3600); //一小时
The above is the detailed content of What to do if php cookie is lost. For more information, please follow other related articles on the PHP Chinese website!