Home >Backend Development >PHP Problem >How to clear cookies in php
How to clear cookies in php
1. Use the function "setcookie()" to set the cookie value to empty or NULL;
//将cookie值设置为空 setcookie ("name", ""); //或者将cookie值设置null setcookie ("name", null);
2. By setting the cookie expiration time to the past time, just set the third parameter of "setcookie()" to "time()-1".
setcookie ("name", "xiaoming", time() - 1);
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of How to clear cookies in php. For more information, please follow other related articles on the PHP Chinese website!