title: Setting session variable after destroying previous session
body: <p>Why isn't the session <code>variable</code> value available on the second page load when I click the "Fake Login" link?</p>
  
  <pre><code>class Fake_login extends CI_Controller {
  
      function __construct() {
          parent::__construct();
  
          echo $this-&gt;session-&gt;userdata('session_id') . '&lt;br&gt;';
          // First Page Load: ee3c7c5da6e465605cd57ad699aacdb3
          // Second Page Load: c82adf312f123d56e3b7b6ab5ec6cafa
  
          echo $this-&gt;session-&gt;userdata('variable') . '&lt;br&gt;';
          // First Page Load: false
          // Second Page Load: false
  
      }
  
      function index($user_id = null){
  
          $this-&gt;session-&gt;sess_destroy();
  
          $this-&gt;load-&gt;library('session');
          $this-&gt;session-&gt;set_userdata('variable', 'approved');
  
          echo $this-&gt;session-&gt;userdata('session_id') . '&lt;br&gt;'; // ee3c7c5da6e465605cd57ad699aacdb3
          echo $this-&gt;session-&gt;userdata('variable') . '&lt;br&gt;'; // approved
  
          echo '&lt;a href="/admin/fake_login/start/' . $user_id . '"&gt;Fake Login&lt;/a&gt;';
  
      }
  
      function start($user_id = null) {
          echo 'here';
      }
  
  }
  </code></pre>
  
  <p>Please note, the session in library in codeigniter is set to <code>autoload</code>.</p>
  
  <p>This is my Session config:</p>
  
  <pre><code>$config['sess_cookie_name'] = 'cisession';
  $config['sess_expiration'] = 172800; // 24 hours
  $config['sess_expire_on_close'] = FALSE;
  $config['sess_encrypt_cookie'] = TRUE;
  $config['sess_use_database'] = TRUE;
  $config['sess_table_name'] = 'cisessions';
  $config['sess_match_ip'] = FALSE;
  $config['sess_match_useragent'] = TRUE;
  $config['sess_time_to_update'] = 172800;
  </code></pre>