title: session in codeigniter not working after redirect
body: <p>I am trying to use session in codeigniter. What I have done:</p>
  
  <pre><code>if ( verifyHashedPassword($this-&gt;input-&gt;post('teacher_password'),$result['teacher_password']))
                      {
                          $this-&gt;session-&gt;set_userdata('teacher_email',$this-&gt;input-&gt;post('teacher_email'));
                          $responseArray['success'] = true;
                      }
  </code></pre>
  
  <p>I am trying to fetch using:</p>
  
  <pre><code>if ( $this-&gt;session-&gt;userdata('teacher_email') )
              {
                  echo "session is set.";
              }
              else
              {
                  echo "session is not set.";
              }
  </code></pre>
  
  <p>after redirection to this page. I am getting alwasy session is not set. Why it is so?</p>
  
  <p>session and cookie configuration is:</p>
  
  <pre><code>$config['sess_driver'] = 'files';
  $config['sess_cookie_name'] = 'ci_session';
  $config['sess_expiration'] = 7200;
  $config['sess_save_path'] = NULL;
  $config['sess_match_ip'] = FALSE;
  $config['sess_time_to_update'] = 300;
  $config['sess_regenerate_destroy'] = FALSE;
  
  /*
  |--------------------------------------------------------------------------
  | Cookie Related Variables
  |--------------------------------------------------------------------------
  |
  | 'cookie_prefix'   = Set a cookie name prefix if you need to avoid collisions
  | 'cookie_domain'   = Set to .your-domain.com for site-wide cookies
  | 'cookie_path'     = Typically will be a forward slash
  | 'cookie_secure'   = Cookie will only be set if a secure HTTPS connection exists.
  | 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
  |
  | Note: These settings (with the exception of 'cookie_prefix' and
  |       'cookie_httponly') will also affect sessions.
  |
  */
  $config['cookie_prefix']    = '';
  $config['cookie_domain']    = '';
  $config['cookie_path']      = '/';
  $config['cookie_secure']    = FALSE;
  $config['cookie_httponly']  = FALSE;
  </code></pre>