A simple way to delete cookies in batches in php, delete cookies in batches in php_PHP tutorial

WBOY
Release: 2016-07-13 10:08:58
Original
856 people have browsed it

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.

www.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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template