title: Tempdata session expires after browser close in codeigniter
body: <p>I'm creating login functionality for my site. I'm using <strong>CI Sessions</strong>. I've two sessions created in my <strong>login model</strong>.The first one is for the temp. user while the second is for the permanent user <strong>(Remember me functionality)</strong>. For the first one, I've the <strong><em>tempdata()</em></strong> &amp; for the second one, i've the <strong><em>userdata()</em></strong>. The <strong>problem</strong> i'm facing is that the session expires after the browser closes.</p>
  
  <p>My <strong>login model</strong> code looks like this:</p>
  
  <pre><code>public function logger($email, $pass, $check)
          {
              $q = $this-&gt;DB-&gt;get_where('users', array('email' =&gt; $email, 'pass' =&gt; $pass));
              if($q-&gt;num_rows() == 1)
              {
                  if(isset($check))
                  {   
                      $this-&gt;session-&gt;set_tempdata('per_ue', $email, 86400*30);
                      $this-&gt;session-&gt;set_tempdata('per_up', $pass, 86400*30);
                      return redirect('uhome');
                  } else {
                      $this-&gt;session-&gt;set_userdata('tmp_ue', $email);
                      $this-&gt;session-&gt;set_userdata('tmp_up', $pass);
                      return redirect('uhome');
                  }
              } else {
                  $login_error = '&lt;p class="text-danger"&gt;Login credentials are incorrect&lt;/p&gt;';
                  $this-&gt;load-&gt;view('coders-community/login', compact('login_error'));
              }
  
          }
  </code></pre>
  
  <p>My <strong>config</strong> setting for session:</p>
  
  <pre><code>$config['sess_driver'] = 'files';
  $config['sess_cookie_name'] = 'ci_session';
  $config['sess_expiration'] = 0;
  $config['sess_save_path'] = NULL;
  $config['sess_match_ip'] = FALSE;
  $config['sess_time_to_update'] = 300;
  $config['sess_regenerate_destroy'] = FALSE;
  </code></pre>
  
  <p>Could anyone tell me why tempdata <strong>ttl (time-to-live)</strong> not working &amp; destrying <strong>tempdata session</strong> after browser closes?</p>