CodeIgniter Forums

Full Version: PHP sessions expire after X minutes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Since few days, I have a problem with my sessions with codeigniter.
They expire after approximately 16/17 minutes. Nothing change in my code and everything was working good before.

Sessions are generated like this :

PHP Code:
$this->session->set_userdata('user'$username); 

My autoload.php :

PHP Code:
$autoload['libraries'] = array('database''session'); 

My config.php :

PHP Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE

My phpinfo (PHP Version 7.2.17) :

[Image: screen.png]

I guess there is a problem with the my config server.

Do you have any idea ?


Thank you Smile
Since your sess_save_path is set to NULL in your config, the sessions are being stored in the path defined by php settings (session.save_path).

You may consider changing this to a path you control and have access to.
There may be some server process cleaning this folder periodically.

I would set sess_expiration and sess_time_to_update to 0 for testing purposes, and change the sess_cookie_name to something else.

Also, check your cookie settings as these may also affect session behavior.