开发者

logged out after 2-3 minutes of inactivity

The session in my application often gets expired.

session_gc_maxlifetime is set to 24 minutes(de开发者_StackOverflow社区fault);

since my apps is a real time application that basically uses AJAX. Every second my ajax function calls a http request. As far as i know my session should not expire because it always called upon the ajax request.

It works for sometime and getting expired very soon sometimes(about 2-3 minutes of inactivity).

Can anyone help me out in solving this problem. Not only my website but the others website hosted in the same server encountered the same problem.

With Thanks and Regards, Trez


The session_gc_maxlifetime is basically useless when sessions share location with other hosted sites: PHP does not track which site owns which session file so the site with the shortest session_gc_maxlifetime is likely to remove session data from all sites.

I suggest you enable a directory for your site and set it with the session_save_path() function before calling session_start().


Can you reproduce this problem on a non-production server?

Have you got any scripts which clean out the sessions directory? Have you looked in the sessions directory to see how old the files are?

If you are not the only one with root access, I'd suspect someone else who is, try talking to them.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜