A simple way to delete cookies in batches in php, delete cookies in batches in php
The example in this article describes the simple implementation method of deleting cookies in batches in PHP. Share it with everyone for your reference. The specific implementation method is as follows:
Copy code The code is as follows:
//Delete a single cookie: set the key value to empty and the time to the expired time
setCookie("name","",time()-60);
//Delete multiple cookies by traversing the array
foreach($_COOKIE as $key=>$value){
setCookie($key,"",time()-60);
}
?>
Key points to know: If you delete all the cookies of a website, the file that saves the cookies of the website will also be deleted; if you only delete one of the cookies, only the cookie information in the file will be deleted.
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/947918.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/947918.htmlTechArticleA simple implementation method of deleting cookies in batches in php, deleting cookies in batches in php This article describes the simple implementation of deleting cookies in batches in php method. Share it with everyone for your reference. Specific implementation method...
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