Okay so I'm pretty confused right now, on why my $_COOKIE
is not being set when the path is set to '/'
, but is set otherwise. As it currently stands this code
setcookie("scauth", $cookie_content, time()+60*60, "/", $_SERVER["HTTP_HOST"]);
returns with the error Undefined index: scauth in C:\xampp\htdocs\pnp_site\media\zoo\elements\supercontact\send.php on line 19
, but if I was remove the two parameters for path
and domain
, and run this code for instance..
setcookie("scauth", $cookie_content, time()+60*60);
The cookie would be instantiated as intended. Which makes this confusing because my understanding of the $path
parameter according to setcookie()
documentation, explicitly states anything under the set path of '/'
will be available within the entire domain (but for some reason it isn't).
The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain.
Any ideas on why this is happening? I'm running Windows 7 ApacheFriends XAMPP Version 1.8
test environment.