aleX_hill Posted March 15, 2010 Share Posted March 15, 2010 I am trying to set a cookie like so: $cookieresult = setcookie("schoolname",$_POST['school'],time()+1000000); $cookieresult holds the value "1" after this, but when i print_r($_COOKIE) it doesnt show up and there seems to be no cookie set. The same happens if I replace the $_POST['school'] with a string like "hi". Any ideas? Link to comment https://forums.phpfreaks.com/topic/195263-cookie-not-setting-no-error/ Share on other sites More sharing options...
aleX_hill Posted March 15, 2010 Author Share Posted March 15, 2010 Dont worry, figured it out. I was writing the cookie from site.com/login/ (although this was redirected using .htaccess) which meant the path was set to /login/ Link to comment https://forums.phpfreaks.com/topic/195263-cookie-not-setting-no-error/#findComment-1026166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.