title: codeigniter redirect doesn't work in the _construct method
body: <p>i want to give access only to the authorized  users
  so i wrote the authentication code in the construct method 
  here is my code</p>
  
  <pre><code>class cp extends CI_Controller {
  
      public function __construct(){
          parent::__construct();
          $this-&gt;this_mustbe_admin();
      }
  
      public function this_mustbe_admin()
      {
  
          $this-&gt;load-&gt;model('m_cp');
          $md = $this-&gt;m_cp-&gt;is_admin();
          if($md)
           return $md;
          else
          {
              redirect(base_url().'cp/login/');
          }
  
      }
  
      function login()
      {   
               $this-&gt;load-&gt;view('admin/login');
  
      }
  </code></pre>
  
  <p>but i get error</p>
  
  <pre><code>The page isn't redirecting properly
  </code></pre>
  
  <p>if i remove <code>this_mustbe_admin</code> method from construct and put it on the other controllers it works fine</p>
  
  <pre><code>function do_stuff(){
  
     $this-&gt;this_mustbe_admin();
     // do stuff 
  
  }
  </code></pre>
  
  <p>but this way i have to write it in each and every one of my methods</p>