I am currently setting a cookie on a PHP page of my subdomain
$asdasd = "1";
$expires = time() + 86400; // 1 day
if (($username == $actualusername) && ($password == $actualpassword))
{
setcookie("loggedin",$asdasd, $expires);
header('Location: exampleurl');
}
I am then trying to read it on another page on the SAME subdomain:
var_dump($_COOKIE[‘loggedin’]);
nothing is returned – even though I can see the cookie set in the browser privacy settings.
Any ideas?
Thanks
the issue must be around path where you set your cookie, in your case solution would be