I am using this code to set a cookie and then see if they exist
setcookie(\"token\", \"value\", time()+60*60*24*100, \"/\"); setcookie(\"secret\", \"value\",
use
if(true === array_key_exists('secret', $_COOKIE) && strlen($_COOKIE['secret']) > 0) { }