Suppose I have the domain www.example.com and in the page test_cookie.php I've written this piece of code:
setcookie("cookie","test",time()+3600*5,"/");
Setting the path parameter to "/" to make it accessible for all paths. What is weird is that when I try to access it from a sub directory such as administration, I cannot. I've tested this peice of code under www.example.com/administration/test_cookie.php:
echo $_COOKIE['cookie'];
It is ever more weird when I tried this code under www.example.com/test_cookie.php
setcookie("cookie","test",time()+3600*5,"/administration");
And again, I couldn't access it from the sub directory.
The phpinfo(); is available here in case you need information about the php installed on the server.
PS: At the same time, the variable is accessible under www.example.com/test_cookie.php