1
votes

I am working on an application in Codeigniter. I want to keep the session even after page refresh but on page refresh it leads to login page again.

My configurations in config file are :

$config['sess_cookie_name']     = 'ci_session';
$config['sess_expiration']      = 0;    // 30 * 60 //default 1800
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 3600;

Gone through many links but could not get any to make it work. Please suggest a solution.

1
increase your session time to $config['sess_expiration'] = '7200' for two days and trySaty
$config['sess_expiration'] =0 is to make it expire never but still no luck.Jyoti Duhan
replace your session library with raw.githubusercontent.com/EllisLab/CodeIgniter/…Saty
Which version of CI are you using? Check this link, stackoverflow.com/questions/18468866/…ℛⱥℐℰşℎ
@Rajesh : it is 2.1.4Jyoti Duhan

1 Answers

0
votes

Try to change the value of "sess_expiration"

$config['sess_expiration'] = 1800;