Welcome Guest, Not a member yet? Register   Sign In
Increasing cookie's expiration time
#1

Hello,

I have an application made using latest CodeIgniter 2 release. I have a custom authentication system linked to an authentication API which is used globally for all our applications. It defines a session and a cookie which have a sess_expiration value of 2 hours (default).

I saw that when I browse (navigating through different controllers) my application for 2 hours long, I get disconnected because the cookie has expired.

Now, what I want is to be able to reset the sess_expiration value to 2 hours, each time a controller is called, but I can't find a method that allow me to do that, and I don't want to destroy the current session to create a new one because it would force me to redefine all userdata, which was set earlier by some of my controllers.

Is that even possible ?

Thanks in advance.

Regards,

$this.
Reply
#2

There's sess_time_to_update, which tells CI how often to re-send the cookie (and refresh the expiration time that way).
Reply
#3

Narf,

Thanks to point me in the right direction !

I now understand a lot better how cookie expiration and update works.

I tried with very small values to see the process in action and it now works fine !

But I noticed in my privacy settings that there were a lot of cookies created by my app, each one matching with an update time... Does this means that the "old" cookie (the one which has not yet been updated) is cloned to a new one with higher expiration values ?

Thanks again !
Reply




Theme © iAndrew 2016 - Forum software by © MyBB