Jump to content

Cookies help?


Eugene

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...
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.