CodeIgniter Forums
Database session frequently expired (before sess_expiration) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Database session frequently expired (before sess_expiration) (/showthread.php?tid=72906)



Database session frequently expired (before sess_expiration) - redjersey - 02-27-2019

I'm using CI 3.1.10. I'm using database to save the sessions and here is my config:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_admin_session';
$config['sess_expiration'] = 14400;
$config['sess_save_path'] = 'ci_admin_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 14400;
$config['sess_regenerate_destroy'] = FALSE;

I have tried setting $config['sess_time_to_update'] to 300 or 14400, also setting sess_expiration to 0 (never expired)

However session still expired way before sess_expiration. I have minimal ajax call and I can't seem to find the answer.


RE: Database session frequently expired (before sess_expiration) - InsiteFX - 02-27-2019

CodeIgniter User Guide - A note about concurrency


RE: Database session frequently expired (before sess_expiration) - redjersey - 02-28-2019

just to make it clear, every time after

this->session->set_userdata($some_array);

I should call
session_write_close() ?


RE: Database session frequently expired (before sess_expiration) - InsiteFX - 02-28-2019

You call it when your finished with the sessions.