When I want to remove a Cookie I try
unset($_COOKIE[\'hello\']);
I see in my cookie browser from firefox that the cookie still exists. How
Just set the expiration date to one hour ago, if you want to "remove" the cookie, like this:
setcookie ("TestCookie", "", time() - 3600);
or
setcookie ("TestCookie", "", time() - 3600, "/~rasmus/", "example.com", 1);
Source: http://www.php.net/manual/en/function.setcookie.php
You should use the filter_input()
function for all globals which a visitor can enter/manipulate, like this:
$visitors_ip = filter_input(INPUT_COOKIE, 'id');
You can read more about it here: http://www.php.net/manual/en/function.filter-input.php and here: http://www.w3schools.com/php/func_filter_input.asp