Home > Backend Development > PHP Problem > How to solve the problem of php cookie closing browser failure

How to solve the problem of php cookie closing browser failure

藏色散人
Release: 2023-03-06 12:16:02
Original
2519 people have browsed it

The solution to the failure of php cookie closing browser: first open the corresponding code file; then modify the code to "$expire = 60 * 60 * 24 * 31;".

How to solve the problem of php cookie closing browser failure

Recommended: "PHP Video Tutorial"

php sets cookie expiration time, why does it become invalid when closing the browser Woolen cloth? How can I remember my password if I can't save cookies?

Framework: CI

Browser: google

Solution:

$timeout = time() + 60 * 60 * 24 * 31;
Copy after login

This variable is to be used as the password expiration time for the database, but I After giving him a cookie, this guy was not happy. He fixed this bug for me and tormented me for a long time...

The correct one is:

$expire = 60 * 60 * 24 * 31;
Copy after login

Done!

The above is the detailed content of How to solve the problem of php cookie closing browser failure. 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