title: configuring Session in codeigniter 3
body: <p>Hello i have been working with codeigniter v2.2 now that i have started using codeigniter v3.0 i get problem in making the session for authentication of the user account i would like to get help on how i can make it work.</p>
  
  <p>The following is the code in the controller.</p>
  
  <pre><code>public function validation(){
  
      $this-&gt;load-&gt;helper('url');
      $this-&gt;load-&gt;library('form_validation');
  
  
      $this-&gt;load-&gt;model('user_model');
  
      $query = $this-&gt;user_model-&gt;validate();
  
  
      if($query) //if credential validated
  
      {
          $data1 = array(
              'email' =&gt; $this-&gt;input-&gt;post('email'),
              'is_logged_in' =&gt; true );
  
          $this-&gt;session-&gt;set_userdata($data1);
  
          redirect('users_area/user_is_in');
  
  
      }
      else{
          $this-&gt;login();
      }
  
  
  }
  </code></pre>
  
  <p>The user_model code is as follows</p>
  
  <pre><code> function validate(){
  
      $this-&gt;db-&gt;where('username',$this-&gt;input-&gt;post('username'));
  
      $this-&gt;db-&gt;where('password', md5($this-&gt;input-&gt;post('password')));
  
  
      $query = $this-&gt;db-&gt;get('tbl_users');
  
      if($query-&gt;num_rows == 1){
  
          $this-&gt;session-&gt;set_userdata(array('authorized' =&gt; true));
  
          return true;
  
      }
  
  }
  </code></pre>
  
  <p>and finally  there is a controller called users_area which is the one that
  check if the session has been set then gives the user access to the page this has always been working in the previous codeigniter versions</p>
  
  <p>users_area controller</p>
  
  <pre><code>function user_is_in(){
  
  
      $is_logged_in = $this-&gt;session-&gt;userdata('is_logged_in');
  
      if($is_logged_in != ""){
  
          $this-&gt;members();
  
      }else {
  
          redirect('verify/signin');
          die();
          //session has to be altered bro
      }
  
  
  }
  
  
  
  function members()
  {
  
      redirect('verify/users_mahali');
  
  }
  </code></pre>