title: Change CodeIgniter session config based on user selection
body: <p>I'm trying to implement a "remember me" checkbox in my login form. Looking at the Docs I see that I can change the config setting by default:</p>
  
  <pre><code>$config['sess_expiration'] = 10; // I set it to 10 seconds for testing
  </code></pre>
  
  <p>What I'm trying to do is extend this time indefinitely, or much longer at least, if the user checks a box. I am changing the value of <code>sess_expiration</code> when the input is passed via the POST, and I can see that the value is changed, but it still expires after the default time, not after the new time.</p>
  
  <pre><code>if ( $this-&gt;input-&gt;post('rememberMe') )
  {
      $this-&gt;config-&gt;set_item('sess_expiration', 0);
  }
  </code></pre>
  
  <p>Just before I set the session information I call this and if I echo it out I see the value is properly set, but I wait and then my session is gone and I am redirected back to my login page.</p>
  
  <pre><code>$this-&gt;session-&gt;set_userdata(
      array('user' =&gt; array(
          'userId' =&gt; $user-&gt;userId,
          'userName' =&gt; $user-&gt;userName,
          'userLevel' =&gt; $user-&gt;userLevel,
          'userEmail' =&gt; $user-&gt;userEmail,
          'userCreated' =&gt; $user-&gt;userCreated,
          'userUpdated' =&gt; $user-&gt;userUpdated,
          'userStatus' =&gt; $user-&gt;userStatus
      ),
      'loggedIn' =&gt; $user-&gt;userId
  ));
  </code></pre>
  
  <p>Am I doing this wrong? I'm spending too much time on this issue so I'll move on and hope someone here can point out what I'm doing poorly.</p>
  
  <p>Thanks!</p>