adam84 Posted March 20, 2007 Share Posted March 20, 2007 This is my code for setting a cookie, but for some reason it is not getting set. Any questions? function login($userID, $userNameVal, $remember){ $this->userid = $_SESSION['userid'] = $userID; $this->userName = $_SESSION['userName'] = $userNameVal; $this->logged_in = $_SESSION['logged_in'] = true; $t = time()+(60*60*24*100); if($remember){ setcookie("cookname", $userNameVal, $t ,"/"); setcookie("cookid", $userID, $t, "/"); } } Link to comment https://forums.phpfreaks.com/topic/43562-cookies/ Share on other sites More sharing options...
per1os Posted March 20, 2007 Share Posted March 20, 2007 is $remember being set. Also is this on localhost? If so see this: http://www.aeonity.com/frost/php-setcookie-localhost-apache Link to comment https://forums.phpfreaks.com/topic/43562-cookies/#findComment-211569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.