title: Codeigniter redirect not working
body: <p>Why isn't redirect working here. I'm getting call to undefined function redirect().</p>
  
  <pre><code>class Login extends CI_Controller {
  
      function index() {
  
          parent::__construct();
          $this-&gt;load-&gt;helper('form');
          $this-&gt;load-&gt;helper('url');
          $this-&gt;load-&gt;view('login_view');        
  
      }
  
      function authenticate() {
  
          $this-&gt;load-&gt;model('user_model');
          $query = $this-&gt;user_model-&gt;authenticate();
  
          if($query) {
  
              $data = array(
                  'username' =&gt; $this-&gt;input-&gt;post('username'),
                  'is_logged_in' =&gt; true
              );
  
              $this-&gt;session-&gt;set_userdata($data);
              redirect('/site/news_feed');
  
          }
          else {
  
              $this-&gt;index();
  
          }
  
      }
  
  }
  </code></pre>