title: Too many redirects in codeigniter 3 authenticate hook
body: <p>I have this as a hook to get user session to all CI controllers, but when I enter into login page I will get net::ERR_TOO_MANY_REDIRECTS. This is my script:</p>
  
  <pre><code>&lt;?php class Authenticate{
    protected $CI;
  
    public function __construct() {
      $this-&gt;CI = &amp; get_instance();
  
    }
    public function check_user_login(){
        if(!$this-&gt;CI-&gt;session-&gt;is_logged_in){
            redirect('main/login');    
        } 
        }
  
  }
  ?&gt;
  </code></pre>