title: codeigniter session not working properly
body: <p>I have some problem with my codeigniter session. I am using CodeIgniter-3.1.8. I loaded session in autoload.php in config as</p>
  
  <pre><code>$autoload['libraries'] = array('database', 'session');
  </code></pre>
  
  <p>But it shows an error like <code>Unable to locate the specified class: Session.php</code>.</p>
  
  <p>Then I removed it from autoload.php and load it in controller.</p>
  
  <pre><code>public function __construct() {
      parent::__construct();
      $this-&gt;load-&gt;library('session');
  }
  </code></pre>
  
  <p>And try to set <code>flashdata</code> in my controller. But now it shows error like <code>Undefined property: controller::$session</code>. I have already set the <strong>encryption_key</strong> in <strong>config.php</strong> and session storage driver to database.
  Here is my sample code from controller :</p>
  
  <pre><code>class Home extends CI_Controller {
      public function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;library('session');
      }
  
      public function register() {
          $data = $this-&gt;input-&gt;post();
          $result = false;     //$this-&gt;Home_model-&gt;register($data);
          if($result){
              $this-&gt;session-&gt;set_flashdata('success', 'Registration successful');
              $this-&gt;session-&gt;set_flashdata('form', 'login');
          }
          else {
              $this-&gt;session-&gt;set_flashdata('failure', 'An error occured, please try again');
              $this-&gt;session-&gt;set_flashdata('form', 'register');
          }
  
       }
  }
  </code></pre>
  
  <p>This issue is coming,  when I am trying to load model</p>