2

I am using CI 1.7.3 and here are my settings:

$config['sess_cookie_name']     = 'ci_session';
$config['sess_expiration']      = 0;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']      = 'sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']      = 300;

I cannot come up with steps that cause the session to expire, it just seems random and is very frustrating for users.

Chris Muench
  • 17,444
  • 70
  • 209
  • 362

1 Answers1

2

I have the same issue. There's a design flaw in the CodeIgniter sessions library that causes the accidental destruction of sessions when two or more requests are submitted in rapid succession (such as when performing several AJAX requests). I've submitted a bug report that explains in more detail here: https://github.com/EllisLab/CodeIgniter/issues/154

For now, you can implement a workaround by setting sess_use_database = FALSE. Hopefully someone resolves this issue soon.

Brad Koch
  • 19,267
  • 19
  • 110
  • 137
  • Some other fixes people have done: http://codeigniter.com/forums/viewthread/172415/ http://www.mattwillo.co.uk/blog/2010-08-23/codeigniter-database-session-fix/ – Brad Koch Apr 28 '11 at 22:38
  • I have not tested the [following method](http://ellislab.com/forums/viewthread/102456/#523991), but it should retain the session id on update. – machineaddict Apr 18 '13 at 06:46