CodeIgniter Forums
CI 3.1.9 session timeout issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: CI 3.1.9 session timeout issue (/thread-72326.html)



CI 3.1.9 session timeout issue - [email protected] - 12-05-2018

My company project runs on CI 3.1.9 version. When there are many users logging into the system, then after some time session automatically gets timeout. I have increased the session expiration and session update in config.php. But same issue(session timeout) is happening everytime. Please help.


RE: CI 3.1.9 session timeout issue - php_rocs - 12-05-2018

@[email protected],

What is your session settings in the CI config.php file?


RE: CI 3.1.9 session timeout issue - [email protected] - 12-06-2018

My config.php session settings

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = sys_get_temp_dir();
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 86400;
$config['sess_regenerate_destroy'] = FALSE;
$config['sess_match_useragent'] = FALSE;


RE: CI 3.1.9 session timeout issue - dave friend - 12-06-2018

Is there be a CRON job that's periodically cleaning up session files?


RE: CI 3.1.9 session timeout issue - php_rocs - 12-06-2018

@[email protected],

Has this just started happening or has it been happening for some time? What version of PHP?

@dave friend
According to the CI documentation ( https://www.codeigniter.com/user_guide/libraries/sessions.html?highlight=garbage%20collector#session-preferences ) Garbage Collection cleans up the session directory.


RE: CI 3.1.9 session timeout issue - dave friend - 12-07-2018

(12-06-2018, 11:51 AM)php_rocs Wrote: @dave friend
According to the CI documentation ( https://www.codeigniter.com/user_guide/libraries/sessions.html?highlight=garbage%20collector#session-preferences ) Garbage Collection cleans up the session directory.

Yes, that is true. But that does not mean that a CRON job to do the same thing cannot be running too.


RE: CI 3.1.9 session timeout issue - [email protected] - 12-08-2018

(12-06-2018, 10:20 AM)dave friend Wrote: Is there be a CRON job that's periodically cleaning up session files?

No there is no cron job which is cleaning the session


RE: CI 3.1.9 session timeout issue - [email protected] - 12-08-2018

(12-06-2018, 11:51 AM)php_rocs Wrote: @[email protected],

Has this just started happening or has it been happening for some time?  What version of PHP?

@dave friend
According to the CI documentation ( https://www.codeigniter.com/user_guide/libraries/sessions.html?highlight=garbage%20collector#session-preferences ) Garbage Collection cleans up the session directory.

No this is happening sometime. But not any specific time.

PHP version 7.2.7


RE: CI 3.1.9 session timeout issue - InsiteFX - 12-09-2018

You may need to set the cookie path in ,/application/config/config.php

PHP Code:
$config['cookie_prefix'  '';
$config['cookie_domain'  '.domainname.com';
$config['cookie_path'    '/';
$config['cookie_secure'  FALSE;
$config['cookie_httponly'] = FALSE

Change the .domainname.com to your host location.