简体   繁体   中英

CodeIgniter session timeout issue

I'm using CI 2.1.4 and I set

$config['sess_expiration'] = 0;

but sometime when I'm in my dashboard I'm unlogged automaticaly by the site…

The context is the following :

I'm using 2 applications for 1 system, but both applications use the same encryption key, session table and the same timeout.

This problem appear when I submit a form then after I pick up session data to add it in the database.

Anyone has an idea ?

Thanks.

I think you have 2 ways to fix it.

  1. First, you should download latest code from github and replace session library folder with downloaded code.
  2. Second, you can extends the session library and check for AJAX request, then update the session as you can see this following discussion about this problem in CodeIgniter Official Forum, it explains to get rid of the problem: http://ellislab.com/forums/viewthread/138823/

Note: The forum location has changed http://ellislab.com/forums/ to http://forum.codeigniter.com and it is hard to find the topic there. You can search if you like or you can follow the #1.

Hope it will helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM