I\'ve tried
$cookie = $_COOKIE[\'cookie\'];
if the cookie is not set it will give me an error
PHP ERROR Undefined index: cook
Use isset to see if the cookie exists.
if(isset($_COOKIE['cookie'])){ $cookie = $_COOKIE['cookie']; } else{ // Cookie is not set }