I\'ve tried
$cookie = $_COOKIE[\'cookie\'];
if the cookie is not set it will give me an error
PHP ERROR Undefined index: cook
Try this:
$cookie = isset($_COOKIE['cookie'])?$_COOKIE['cookie']:''; //checks if there is a cookie, if not then an empty string