[eluser]guidorossi[/eluser]
I thought that the cookies created by set_cookie should be independent of the $config...
I've tryied turning expire on close to FALSE but it only affects the ci_session cookie and not the other one...
Anyway, I've solved this issue by using the native PHP setcookie() insted of set_cookie...
Code:
private function set_remember_me($id)
{
$this->ci->load->library('encrypt');
$token = md5(uniqid(rand(), TRUE));
$expire = time()+60*60*24*7; // Set the remember cookie for a week
$remember_code = $this->ci->encrypt->encode(serialize(array($id, $token, $expire)));
$cookie = array(
'name' => 'rememberme',
'value' => $remember_code,
'expire' => $expire
);
// For DB insertion
$cookie_db_data = array(
'id' => $id,
'remember_code' => $token
);
//$this->ci->input->set_cookie($cookie);
setcookie('rememberme', $remember_code, $expire);
$this->ci->auth_model->edit_user($cookie_db_data);
}