CodeIgniter Forums
a question about the session - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: a question about the session (/showthread.php?tid=36163)



a question about the session - El Forum - 11-23-2010

[eluser]Unknown[/eluser]
hey guys
recently i have write a web-site using ci,but i meet some questions,that is sometimes i try to redirect url from a controller to another ,i was logged out!!
ps:this web-site is also built on linkster(anyone used it?),it has some libraries,functions,helpers etc.. for ci ,and i use the access lib for login/out module
i also want to know the different between $config['sess_time_to_update'] and $config['sess_expiration'] at config.php line 234
thanks allSmile


a question about the session - El Forum - 11-23-2010

[eluser]pickupman[/eluser]
The 'sess_time_to_update' is for a garbage collection. CI will purge any old session of last activity that have passed in seconds. The 'sess_expiration' is how long a session will last after last activity. This way CI is not trying to delete old sessions every page request.

On your logout issue, do you have any logic in your code that could be causing you to be logged out? Is it always from a specific url? Are you using a Flash based file uploader?


a question about the session - El Forum - 11-24-2010

[eluser]WanWizard[/eluser]
no, 'sess_time_to_update' is the session_id rotation time. The session library generates a new session id with the interval you specify here.

Purging old session records happens based on gc_probabililty, and only purges records with a last update timestamp past the sess_expiration time.