1
votes

I am new in codeigniter. I wanna change $config['sess_expiration'] default value but don't working when ı set sess_expiration value as another value. For example I set it value as 2 and I was thinking will be session expired after 2 second but it don't be it. I tried many available fix but I can't get any result. My config settings as:

 $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;

I don't think to need ci_sessions table for I don't use sess_use_database in my config settings. What should I do?

Edit:

My codeigniter version 3.1.0. As far as I can see this version's session library is not containing sess_read() or sess_update() methods or sess_expiration class variable.

1
'$config['sess_save_path']' must be an absolute path. It cannot be null. - DFriend
I set ci_sessions folder for '$config['sess_save_path']'. I set '$config['sess_save_path']' that: $config['sess_save_path'] = APPPATH . 'ci_sessions/'; but I can not get that result I wanted. @DFriend - aalicenk
I think I using an old session library. Because My session library don't contain that recommended solution's sess_read() and sess_update() methots. @H45H - aalicenk
By the way, I cannot see sess_read() and sess_update() methods in codeigniter latest version in session library. @H45H - aalicenk

1 Answers

0
votes

i think it is loading from cache or some where else.

so try to set time whenever you set session where you set session call config and change it

$this->session->sess_expiration = 60; // 1-min

then set your user data

$this->session->set_userdata(' whatever you want ');