pbreit - 23 March 2006 02:52 PM
If no expiration date is specified, the cookie will expire when the browser is closed.
So if I set sess_expiration to 0 then manually do timeouts based on last_activity in my sessions db with something like this:
$this->db->use_table('ci_sessions');
$conditions = array('session_id' => $this->session->userdata('session_id'),
'ip_address' => $this->session->userdata('ip_address'),
'user_agent' => $this->session->userdata('user_agent'));
$this->db->where($conditions);
$query = $this->db->get();
$row = $query->row();
if ($row->logged_in) {//user has valid session
$now = time();
$idle = $now - $row->last_activity;
if ($idle > 36000) //timeout after 10 minutes of inactivity
$this->logout();
...
I should be good to go?