title: Codeigniter userdata lost after session id refresh [CodeIgniter 3.0]
body: <p>Im using the Session Library of Codeigniter on my Website connected to a MySQL Database.
  I have my own Library that works with the session wich is created to handel the login check.</p>
  
  <p>Basically when i log in i store that i'm logged in, in the userdata from the session cookie. (then there are other checks to have some sort of security)</p>
  
  <pre><code>$this-&gt;session-&gt;set_userdata('logged_in','1');
  </code></pre>
  
  <p>Now as soon as the session id gets refreshed (standard 300 seconds) all my userdata is gone. I cheked in the Database and there the session Id is not getting updated it just creates a new one. </p>
  
  <p>I'm using the Codeigniter 3.0 and im not sure if thats supposed to work like that.</p>
  
  <p>Edit: </p>
  
  <p>my config.php (session stuff)</p>
  
  <pre><code>$config['sess_driver'] = 'database';
  $config['sess_cookie_name'] = 'ci_session';
  $config['sess_expiration'] = 0;
  $config['sess_save_path'] = 'ci_sessions';
  $config['sess_match_ip'] = FALSE;
  $config['sess_time_to_update'] = 300;
  $config['sess_regenerate_destroy'] = FALSE;
  </code></pre>
  
  <p>cookie Stuff</p>
  
  <pre><code>$config['cookie_prefix']    = '';
  $config['cookie_domain']    = '';
  $config['cookie_path']      = '/';
  $config['cookie_secure']    = FALSE;
  $config['cookie_httponly']  = FALSE;
  </code></pre>
  
  <p>Basically what happens ist the following thing:</p>
  
  <p>I get the Session with the id 123. I assign the userdata logged_in = 1 to the session.
  All is saved in the DB.
  After 5 minutes. (Or the Time defined in the config file)</p>
  
  <pre><code>$config['sess_time_to_update'] = 300;
  </code></pre>
  
  <p>I get in my Browser a new session with the id 137 without the userdata.
  The Session 123  with the userdata logged_ind = 1 is still in the database, together with the newly created session 137.</p>
  
  <p>So instead of an update "sess_time_to_update" its more creation of a new session.</p>