title: How to prevent user from accessing certain pages if not logged in in codeigniter
body: <p>Currently if i accessed main/subscriber am able to view page when not logged in I have created a function in Main controller -refer to <a href="https://stackoverflow.com/questions/53142772/redirect-to-a-page-based-on-user-roles-in-codeigniter/53145103">User role page redirect codeigniter</a> for clarity on code.</p>
  
  <pre><code>public function subscriber() {
  
      $this-&gt;load-&gt;view('header', $data);
      $this-&gt;load-&gt;view('dashboard/subscriber', $data);
      $this-&gt;load-&gt;view('footer');
      }
  </code></pre>