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

What to do if php cookie is lost

藏色散人
Release: 2023-03-06 17:32:01
Original
2231 people have browsed it

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);
Copy after 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); //一小时
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template