开发者

Codeigniter session using ajax

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 th开发者_如何学Goe 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜