CodeIgniter Forums
RA_session how to ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: RA_session how to ? (/showthread.php?tid=36389)



RA_session how to ? - El Forum - 11-30-2010

[eluser]Unknown[/eluser]
Hello,

I am a pretty new to codeIgniter.

I am trying to add a 'Remember Me' feature to my website and i'm using the the RA_session library.

I copy/pasted the library to my libraries folder. I tried adding the ra_session->set_userdata() in my login function but it's not working, the session still expires:

Code:
$this->load->library('RA_Session');
...
if ($valid)
{
      $data = array(
        'username' => $this->input->post('username'),
        'is_logged_in' => true      
      );
      $this->ra_session->set_userdata($data);
      $this->session->set_userdata($data);
      redirect('members/home');
}

I would really appreciate it if somebody can explain to me how to use the library.
Thanks.