title: redirect is not working in codeigniter _construct function
body: <p>I am facing a problem using redirect in _construct function, 
  In timesheet controller I wrote the following code and I am getting an error in the browser "</p>
  
  <blockquote>
    <p>This problem can sometimes be caused by disabling or refusing to
    accept
        cookies.</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>class Timesheet extends MY_Controller {
  
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;model('timesheet_model');
          //$this-&gt;load-&gt;library('auth');
          $username=$this-&gt;session-&gt;userdata('logged_in');
  
          //$this-&gt;load-&gt;model('login_model');
          if($username['fullname']!=""){
          redirect('timesheet');
  
          }
          else{
          redirect('login');
          }
  
      }
  </code></pre>
  
  <p>Please help me to find a way to get rid of this problem. 
  Thanks.</p>