• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sessions destroys in CodeIgnitor

#1
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).
Reply

#2
have you tried $config['sess_expiration'] = -1;
God Bless CI Contributors Smile
Reply

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

What? Why should I trying "-1"?
Reply

#4
-1 is to live session forever as long as it is not destroyed
God Bless CI Contributors Smile
Reply

#5
(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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.