Home > Article > Backend Development > How to solve the problem of php cookie closing browser failure
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;".
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;
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;
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!