File 1: setcookie.php
<?
$cookie_name = "whatever";
$domain_name = ".yourdomain.com";
setcookie("$cookie_name","1",time()+(365243600),"/","$domain_name"); //setcookie life to a year
?>
File 2: checkcookie.php
<?
$cookie_name = "whatever";
if (isset($cookie_name)==1):
echo "Cookie found!";
else:
echo "Cookie NOT found!";
endif;
?>
File 3: removecookie.php
<?
$cookie_name = "whatever";
$domain_name = ".yourdomain.com";
setcookie("$cookie_name","1",time()-(30243600),"/","$domain_name");
?>
First visit setcookie.php, this should set the cookie
Check cookie existence with checkcookie.php
Remove cookie with removecookie.php
Check that cookie doesn't exist anymore with checkcookie.php
Hope this helps.
Z.