very simple question.
This is my index.php:
<?php
setcookie("testcookie", "i am value of cookie", 86400, '/');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<a href="newpage.php">go to next</a>
</body>
</html>
this is my newpage.php:
<?php
echo "ok ok ";
echo $_COOKIE["testcookie"];
?>
My second page echoes "ok ok " but it doesn't echo the cookie. I checked network, the index.php has the cookie "testcookie" but newpage.php doesn't have access to it if I click the link.
I'm using MAMP.