#native_company# #native_desc#
#native_cta#

Detecting if user has cookies enabled/disabled

By Norman
on September 6, 2003

Version: 2.0

Type: Full Script

Category: Other

License: WebSite Only

Description: Detect if a user has cookies enabled or disabled.

<?PHP
// Set Temporary Cookie
setcookie("TEMPCOOKIE", "NOVALUE", time() + 60 * 60);
// Set Cookie Variable
if ($cookieinfo = $HTTP_COOKIE_VARS["TEMPCOOKIE"])
{
   if ($cookieinfo == "NOVALUE")
   {
      echo "You have cookies!";
      exit;
   }
   else
   {
      echo "You don't have cookies!";
      exit;
   }
}
?>