title: codeigniter login check for all functions(tabs)
body: <p>i have a function for login controls. if user didnt login it redirects to <code>login.php</code></p>
  
  <p>in my controller i have to many functions and this functions represents pages in website. so do i have to call <code>$this-&gt;is_logged_in();</code> function in each function. </p>
  
  <p>for example:</p>
  
  <pre><code>class Admin extends CI_Controller{
  
  
          function index(){
              $this-&gt;is_logged_in(); // works fine like this
                  $this-&gt;load-&gt;view('admin/welcome_message');
          }
  
          function users(){
              $this-&gt;is_logged_in(); // works fine like this
                  $this-&gt;load-&gt;view('admin/users');
          }
  
          function comments(){
              $this-&gt;is_logged_in(); // works fine like this
                  $this-&gt;load-&gt;view('admin/comments');
          }
  
  }
  </code></pre>
  
  <p>i dont want to call this function in all function. when i call this in construct result is: infinite loop.</p>