title: User not redirecting to the page after registering but registration working successfully in codeigniter
body: <p>The problem here is that registration is working properly but it is not redirecting to certain page which i want.because to go to that page which is in another controller,  id should be set on session .bt even after setting id to session it not working .help me out thank you..here is the code </p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>      public function newregister()
        {   
        if($this-&gt;session-&gt;userdata("passenger_id"))
        return redirect("user/dashboard");
        $this-&gt;load-&gt;view('userregister');
        }
        public function register()
        {
        $this-&gt;form_validation-&gt;set_rules('fname', 'Fullname', 'required|min_length[5]|max_length[42]|trim|alpha_numeric_spaces');
        $this-&gt;form_validation-&gt;set_rules('uname', 'Username', 'trim|required|min_length[5]|max_length[12]|is_unique[passengers.uname]');
        $this-&gt;form_validation-&gt;set_rules('dob', 'Date of birth', 'required');
        $this-&gt;form_validation-&gt;set_rules('gender', 'Gender', 'required');
        $this-&gt;form_validation-&gt;set_rules('mobile', 'Mobile Number', 'trim|required|max_length[10]|min_length[10]');
        $this-&gt;form_validation-&gt;set_rules('city', 'City', 'required');
        $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'trim|required|valid_email');   
        $this-&gt;form_validation-&gt;set_rules('pword', 'Password', 'trim|required|min_length[8]');
        $this-&gt;form_validation-&gt;set_rules('confirmpword', 'Confirm Password', 'trim|required|min_length[8]|matches[pword]');
        $this-&gt;form_validation-&gt;set_error_delimiters('&lt;p class="text-danger"&gt;','&lt;/p&gt;');
            if($this-&gt;form_validation-&gt;run()){
          $this-&gt;load-&gt;model('user_model');
          $pdata=array(
              'passenger_id'=&gt;$this-&gt;input-&gt;post('passenger_id'),
              'fname'=&gt;$this-&gt;input-&gt;post('fname'),
              'uname'=&gt;$this-&gt;input-&gt;post('uname'),   
              'dob'=&gt;$this-&gt;input-&gt;post('dob'),
              'gender'=&gt;$this-&gt;input-&gt;post('gender'),
              'mobile'=&gt;$this-&gt;input-&gt;post('mobile'),
              'city'=&gt;$this-&gt;input-&gt;post('city'),
              'email'=&gt;$this-&gt;input-&gt;post('email'),
              'pword'=&gt;sha1($this-&gt;input-&gt;post('pword')),
              'confirmpword' =&gt;sha1($this-&gt;input-&gt;post('confirmpword'))
          );
  
          if($this-&gt;user_model-&gt;user_validate($pdata))
          {   
  
  
              $this-&gt;session-&gt;set_userdata($pdata);
              $this-&gt;session-&gt;set_flashdata('message','You have successfully registered to SMS TravelBook... ');
              return redirect('user/dashboard');
          } 
          else{
              $this-&gt;session-&gt;set_flashdata('message','Sorry failed to register');
              return redirect('home/register');
          }
      }
      else{
          $this-&gt;newregister();
      }
  
  }
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>     public function user_validate($pdata)
       {
           return $this-&gt;db-&gt;insert('passengers',$pdata);
       }
  </code></pre>