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? Quote 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/ Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.