CodeIgniter Forums
Question about Cookie expiration - 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: Question about Cookie expiration (/showthread.php?tid=49931)



Question about Cookie expiration - El Forum - 03-07-2012

[eluser]Kraig[/eluser]
In the config file I changed config['sess_expiration'] to be equal to 10 seconds...testing purposes.

Now in my code after the user has logged in I try and reset the sess_expiration by use of the following code:

Code:
$this->session->set_userdata($data);
    $this->config->set_item('sess_expiration', 7200);
    redirect('home/home');

How come the user is still being logged out after 10 seconds? Did I not change it to 7200??


Question about Cookie expiration - El Forum - 03-07-2012

[eluser]CroNiX[/eluser]
But then you redirect, which loads a new controller, which loads the config...


Question about Cookie expiration - El Forum - 03-07-2012

[eluser]Kraig[/eluser]
So really if I have 10 in the sess_expiration, then that will override anything...? I'm trying to add a remember me check box, and it's just not working.


Question about Cookie expiration - El Forum - 03-07-2012

[eluser]CroNiX[/eluser]
How are you doing it? Have you looked at how some of the existing auth libraries that are available do it?


Question about Cookie expiration - El Forum - 03-07-2012

[eluser]Kraig[/eluser]
I have only tried to change the config session. Do you by chance have a link to another way?

Thank you!