title: redirect function setted to refresh doesn't work correctly
body: <p>I'm building a jquery mobile site and using codeigniter.I build a login and main page.I used <code>redirect</code> function but setted it to refresh, doesn't allow to load correctly main page. Setted it to 'location' load the main page correctly but the URL remain that of login page even if I login correctly and show main page.I should see in the url the main page controller</p>
  
  <p><img src="https://i.stack.imgur.com/GDl35.png" alt="enter image description here"></p>
  
  <h2>Login Controller</h2>
  
  <pre><code>    &lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');
  
  /**
   * Description of login_form
   *
   * @author apocalipse89
   */
  class Login extends CI_Controller 
  {
      public function __construct() 
      {
          parent::__construct();
          $this-&gt;load-&gt;model('User','user'); /* This call the model to retrieve data from db */
      }
  
      public function index()
      {
          if(!file_exists('application/views/_login.php'))
          {
              show_404();
          }
  
          $this-&gt;load-&gt;library('form_validation');
  
          $this-&gt;form_validation-&gt;set_error_delimiters('&lt;h4 style="text-align:center;"&gt;','&lt;/h4&gt;');
  
          $this-&gt;form_validation-&gt;set_rules('username','username','trim|required|xss_clean');
          $this-&gt;form_validation-&gt;set_rules('password','password','trim|required|xss_clean|callback_pass_check');
  
          if($this-&gt;form_validation-&gt;run() == FALSE)
          {
              /* Data to pass to view */
              $data['title'] = "User Access";
              $data['author'] = "Salvatore Mazzarino";
              $data['year'] = date('Y');
  
              $this-&gt;load-&gt;view('templates/_header',$data);
              $this-&gt;load-&gt;view('_login',$data);
             /* $this-&gt;load-&gt;view('templates/_footer',$data);*/
          }
          else 
          {   
              redirect('home','refresh');
          }
      }
  
      public function pass_check($pass)
      {        
          $result = $this-&gt;user-&gt;find_user($this-&gt;input-&gt;post('username'),$pass);
  
          if(!empty($result))
          {            
                  $session_array = array('id'=&gt; $result-&gt;id, 'username'=&gt; $result-&gt;username); /* Create a session passing user data */
  
                  $this-&gt;session-&gt;set_userdata('logged_in', $session_array);
  
                  return TRUE;
          }
          else
          {
              $this-&gt;form_validation-&gt;set_message('pass_check',"Invalid username or password!&lt;/br&gt;Try again, please!");
              return FALSE;
          }
      }
  }
  
  /* END OF FILE */
  </code></pre>
  
  <h2>Home Controller</h2>
  
  <pre><code>  &lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  /**
   * Description of home
   *
   * @author apocalipse89
   */
  class Home extends CI_Controller
  {
      public function __construct()
      {
          parent::__construct();
      }
  
      public function index()
      {        
          if($this-&gt;session-&gt;userdata('logged_in'))
          {                        
              $data['title'] = "Management Emergency";
              $data['author'] = "Salvatore Mazzarino";
              $data['year'] = date('Y');
  
              $this-&gt;load-&gt;view('templates/_header', $data);
              $this-&gt;load-&gt;view('_home',$data);
              $this-&gt;load-&gt;view('templates/_footer',$data);
          }
          else
          {
              redirect('home');
          }
      }
  
      public function logout()
      {
          $this-&gt;session-&gt;unset_userdata('logged_in');
          redirect('home');
      }
  }
  
  /* END OF FILE */
  </code></pre>