title: Codeigniter session data lost after redirect
body: <p>I am using codeigniter 2.1.0.</p>
  
  <p>I am trying to do a register/login function using the session library in the codeigniter.</p>
  
  <p>The register/login with the session library worked fine for localhost, but when I put it live and tried it, the session does not work.</p>
  
  <p>My controller login works this way. I check the credentials, once ok I set my session data and redirect to another page.</p>
  
  <pre><code>$user_data = array(
                     'username'       =&gt; $result-&gt;user_name,
                     'email'          =&gt; $result-&gt;user_email,
                     'userid'         =&gt; $result-&gt;user_id,
                     'role'           =&gt; $result-&gt;user_role,
                     'login_state'    =&gt; TRUE,
                     'lastlogin'      =&gt; time(),
                 );
  
  $this-&gt;session-&gt;set_userdata($user_data);           
  print_r( $this-&gt;session-&gt;all_userdata());            
  redirect(base_url('dashboard'));
  </code></pre>
  
  <p>at this point here when I print all my session data, they do print out. But at the dashboard controller side, when i attempt to print the session data out, they were not there anymore. </p>
  
  <p>Any idea why? Thanks in advance for the help.</p>