BBGaming Posted August 11, 2007 Share Posted August 11, 2007 setcookie("name","value",time()+3600); echo($_COOKIE['name']); Why is this returning nothing? Also isset(...) returns false. Everything I've tried has no effect. Quote Link to comment https://forums.phpfreaks.com/topic/64442-solved-cookie-not-setting/ Share on other sites More sharing options...
Orio Posted August 11, 2007 Share Posted August 11, 2007 http://www.php.net/setcookie Scroll down to "common pitfalls" and there you will find your answer- You can only access the cookie on the next page. Orio. Quote Link to comment https://forums.phpfreaks.com/topic/64442-solved-cookie-not-setting/#findComment-321295 Share on other sites More sharing options...
BBGaming Posted August 11, 2007 Author Share Posted August 11, 2007 Hmm... That explains why my tests don't work. It was actually a problem with my coding, I set the parameters of the if statement backwards (so I had what I wanted to happen if it was true, happen when it was false. ), so I just put ! in front of it, and it works now. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/64442-solved-cookie-not-setting/#findComment-321299 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.