Eugene Posted September 26, 2006 Share Posted September 26, 2006 I've tried LITERALLY, PHYSICALLY, TECHNICALLY, everything to get my cookies to set on my website. It just doesn't work. When I set them on my own PHPServer (EasyPhp 1.7) it works like a charm. When I do it on my online server, nothing happens? Help? All the code is in the headers, I don't get the problem... Quote Link to comment Share on other sites More sharing options...
trq Posted September 26, 2006 Share Posted September 26, 2006 You might want to show us some code. Quote Link to comment Share on other sites More sharing options...
Eugene Posted September 26, 2006 Author Share Posted September 26, 2006 [code=php:0]<?phpclass cookies { // <start function> function bake($username, $password, $cname) { setcookie('username', $username, 60 * 60 * 24 * 60 + time()); setcookie('password', $password, 60 * 60 * 24 * 60 + time()); setcookie('cname', $cname, 60 * 60 * 24 * 60 + time()); } // </end function> // </start function> function eat($username, $password, $cname) { setcookie('username', $username, -60 * 60 * 24 * 60 + time()); setcookie('password', $password, -60 * 60 * 24 * 60 + time()); setcookie('cname', $cname, 60 * 60 * 24 * 60 + time()); } // </end function>} ?>[/code]Thats the cookie function itselfThe following is the code that initiates the cookies. It works on my server, but it doesn't actually set the cookies online.[code=php:0]if($this->_sql->myclass->_rows[2] == $this->_password) { if(!empty($this->_remember)) { $this->_cookie = new load("cookies"); $this->_cookie->rsnclass->bake($this->_username, $this->_password, $this->_sql->rsnclass->_rows['cname']); $this->_sql->rsnclass->DBQUery("UPDATE sometable SET login_time = '$this->_login_time' WHERE username = '$this->_username'"); $this->_login->rsnclass->redirect("index.php?go=cc/admin"); }[/code]Like I said, that code works fine, it's the cookies I have a problem with. Quote Link to comment Share on other sites More sharing options...
Eugene Posted September 26, 2006 Author Share Posted September 26, 2006 Fixed. I just used ob_start(); function. Thanks a lot for the Headers tip. Quote Link to comment 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.