I have set up a simple login page on http://mywebsite.com/control
. When you login, it places a cookie called user
on your computer. To set the cookie I simply use:
setcookie("user", $_POST['IGN']);
When I am on the directory /control
, it works fine. For example, if I use the code:
echo $_Cookie['user'];
it echos out the cookie information. However, if I do this on any page that is not in the /control
directory, it says:
Notice: Undefined index: user in /var/www/other/vars.php on line 16
Line 16 is where it echos. This is an image of the cookie information in Chrome: