Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Rajib Palit
Added: Mar 5, 2018 12:12 PM
Views: 6
Tags: no tags
  1. if (isset($_SERVER['HTTP_COOKIE'])) {
  2.     $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
  3.     foreach($cookies as $cookie) {
  4.         $parts = explode('=', $cookie);
  5.         $name = trim($parts[0]);
  6.         setcookie($name, '', time()-1000);
  7.         setcookie($name, '', time()-1000, '/');
  8.     }
  9. }