PHP Session et Cookies: Vérifier si les cookies sont activés

Author:
 
<?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!";
 
        }
    }
 
?>
  
  

Leave a Reply

Your email address will not be published. Required fields are marked *


× four = 12