Jump to content

Archived

This topic is now archived and is closed to further replies.

Eugene

Cookies help?

Recommended Posts

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...

Share this post


Link to post
Share on other sites
[code=php:0]
<?php
class 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 itself
The 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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.