Code has been added to clipboard!

PHP Cookie Preparation

Example
<?php
  $name = 'user_cookie';
  $value = 'Alexander Portman';  	
  setcookie($name, $value, time() + (86400 * 80), '/');
?>
<html>
  <body>
    <?php
      if(!isset($_COOKIE[$name])) {    
        echo "Cookie called '" . $name . "' has not been set!";
      } else { 
        echo "Cookie '" . $name  . "' has been set!<br>";    
        echo "Value in cookie is: " . $_COOKIE[$name];
      }
    ?>
  </body>
</html>