Checking for Cookie Support from PHP
<?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!";
}
}
?>
Related examples in the same category