The cookie is set here: http://wouldyouratherquestions.net/include/click.php?id=1 an will also display there on the second reload, but the strange part is wont work on any ny other page on the site. I call the cookie an it's vanished but go back to that page an refresh an still is set anyone know what the problem is? $id = $_GET['id']; $value = '2'; setcookie($id,$value, time()+3600*336,'/'); echo $_COOKIE[$id]; PHP: This is the code for the above page. This is the code on home page I'm calling the cookie an doesn't work. $id = $row['id']; echo $_COOKIE[$id]; PHP: Will not work on any page but that one page above weirdest thing ever. Please help tried a lot of solutions.
Try this: $domain = '.example.com'; setcookie($id,$value, time()+3600*336,'/', $domain); PHP: Also use your browser to view cookies and see when they're loaded and if they are removed too quickly.