Home  >  Article  >  Backend Development  >  What to do if php cookie is lost

What to do if php cookie is lost

藏色散人
藏色散人Original
2020-10-16 09:29:392029browse

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);".

What to do if php cookie is lost

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn