Welcome Guest, Not a member yet? Register   Sign In
session keeps expiring
#11

[eluser]keevitaja[/eluser]
hey, have i misunderestood the ci sessions... is the session_id supposed to change? it changes in db and in cookie?

basically i have to use my own created hash, incase i don't want it to be changed?
#12

[eluser]keevitaja[/eluser]
not sure, if i'm supposed to that, but it saved my day
Code:
class MY_Session extends CI_Session {
  function sess_update() {
    
    $session['old'] = $this->userdata['session_id'];
    
    parent::sess_update();
    
    $session['new'] = $this->userdata['session_id'];
    
    $this->CI->db
      ->where(array('session_id' => $session['old']))
      ->update('logged_users', array('session_id' => $session['new']));
  }
}
#13

[eluser]InsiteFX[/eluser]
If you do not want it to change then change your settings!
Code:
$config['sess_time_to_update'] = 63072000;  // update in 2 years
$config['sess_expiration']     = 0;         // is the same as above value!

But keep in mind this will not update the values in the database or cookie.
It will however update the session userdata.




Theme © iAndrew 2016 - Forum software by © MyBB