[eluser]35mm[/eluser]
Why is the cookie expiry time not setting? They are being set to expire at the end of browser session. Basically time()+xxxxx is failing. If I enter an actual number it works. This is running in a model. Is there some reason why time()+xxxx won't work in a model? Been staring at this for to long!
Code:
// set cookies
if($remember === TRUE){
$cookie_expire = time()+2419200; // 1 month
}else{
$cookie_expire = time()+10800; // 3 hrs
}
// user cookie
$user_username = $session_new['username'];
$this->load->library('user_agent');
$new_useragent = $this->session->userdata('user_agent');
$user_ID = $session_new['user_id'];
$cookie_user = array(
'name' => 'user',
'value' => md5($user_username) . '_' . $user_ID . '_' . $cookie_expire . '_' . md5($new_useragent),
'expire' => $cookie_expire
);
$this->input->set_cookie($cookie_user);