Home > Article > Backend Development > How to clear cookies in php
How to clear cookies in php: 1. Delete directly, the code is [setcookie("users");]; 2. Clear it by setting the expiration time, the code is [setcookie("users","OKadmin" ,time()-1);setcookie(....)].
How to clear cookies in php:
There are two ways to delete cookies
One: Delete directly
setcookie("users");
Two: Set the expiration time
setcookie("users","OKadmin",time()-1); setcookie("users","OKadmin",0); //浏览器关闭 是自动失效
Related video recommendations:PHP Programming from beginner to master
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!