CodeIgniter Forums
Sessions destroys in CodeIgnitor - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: Issues (https://forum.codeigniter.com/forum-19.html)
+--- Thread: Sessions destroys in CodeIgnitor (/thread-65761.html)



Sessions destroys in CodeIgnitor - KorobOKen - 07-20-2016

I have a PHP site written with CodeIgnitor 3. I store sessions in database table. The problem is sessions' destroys after about 30-40 minutes of it's life during day time, and after about 60-80 minutes at night. The oldest sessions just removes from table while other still live.

My config:

Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = '<cookie_name>';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = '<table_name>';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 30000;
$config['sess_regenerate_destroy'] = FALSE;

Earlier I was using 
Codeigniter 2 and problem was the same.

I want to sessions live at least 8 hours (or unlimited sessions).


RE: Sessions destroys in CodeIgnitor - marksman - 07-20-2016

have you tried $config['sess_expiration'] = -1;


RE: Sessions destroys in CodeIgnitor - KorobOKen - 07-20-2016

(07-20-2016, 10:06 PM)marksman Wrote: have you tried $config['sess_expiration'] = -1;

What? Why should I trying "-1"?


RE: Sessions destroys in CodeIgnitor - marksman - 07-21-2016

-1 is to live session forever as long as it is not destroyed


RE: Sessions destroys in CodeIgnitor - Narf - 07-21-2016

(07-20-2016, 10:30 PM)KorobOKen Wrote:
(07-20-2016, 10:06 PM)marksman Wrote: have you tried $config['sess_expiration'] = -1;

What? Why should I trying "-1"?

You shouldn't.
What you should try if you want 8 hours is 8 * 60 * 60.