If you use JavaScript, it won’t work on the Internet Explorer because IE got a bug.

      setcookie ('test', 'test', time() + 60);
      if (!isset($test) && !isset($_COOKIE['test'])
          && !isset($HTTP_COOKIE_VARS['test'])) {
          echo "Cookie is not working";
      } else {
          echo "Cookie is working";
     }