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

How to solve the problem of php cookie closing browser failure

藏色散人
藏色散人Original
2020-10-06 09:25:442467browse

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;

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!

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