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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/64442-solved-cookie-not-setting/#findComment-321299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.