Home>Article>Backend Development> What does it mean when the timestamp in setcookie in php is 0?

What does it mean when the timestamp in setcookie in php is 0?

藏色散人
藏色散人 Original
2022-01-12 10:00:35 1625browse

The timestamp in setcookie in php is 0, which means setting the expiration time to 0. That is, when the cookie value is set to 0, the cookie will be cleared immediately when the user exits the browser.

What does it mean when the timestamp in setcookie in php is 0?

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

Time stamp in setcookie in php What does 0 mean?

PHP setcookie() The expiration time is set to 0

When the cookie value is set to 0

If chrome exits, the cookie will be cleared.

Because the behavior of Windows and Mac are different. On Windows, as long as I close all the windows of the browser, chrome will exit and the cache will be cleared. On MAC, chrome can only force quit when chrome exits. It will be cleared.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What does it mean when the timestamp in setcookie in php is 0?. 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