So there is such a code.
if (isset($_COOKIE['mypages'])) { header('Location: (переадресация на друг страницу)'); } else { $visit = "active"; setcookie("mypages", $visit, time() + 7 * 24 * 60 * 60, $mycook); }
I go to the browser I look at the cookies, everything is recorded, everything is fine, there is a cookie, there is a parameter, but $_COOKIE['mypages']
doesn’t see anything next time. And they say the cook was not found.
$mycook
? - chernomyrdin$_SERVER['HTTP_HOST']
contains the host name, not the path to it, the documentation says that the 4th parameter is the path for which the cookie will be issued later. PS Do not forget to accept the answer - chernomyrdin