使用Ajax的Codeigniter会话

i know maybe it's a repetitive question, but i would like to know if someone has a good idea for leave user session alive when using ajax calls.

I figured out that when i'm logged and i leave the browser open for 1-2 hours, when i launch ajax calls the session is expired.

i'm using the standard:

$config['sess_time_to_update']  = 7200;

i would like to know if someone has the definitive way to keep alive the user session, better without using interval js functions

The session time is set in the __construct() so you could just call any method from the session library when you are making the ajax call and it should update your session expiration time. I would probably just set an "ajax_request" item in the session just to call the library and fire the constructor to reset the session expiration time.