<?php if(!isset($_GET['testcookie'])) { setcookie("testcookie", "test value"); header("Location: {$_SERVER["PHP_SELF"]}?testcookie=1"); exit; } else { if(isset($_COOKIE['testcookie'])) { setcookie("testcookie"); echo "You have cookies enabled"; } else { echo "You do not support cookies!"; } } ?>