开发者

logged out after 2-3 minutes of inactivity

开发者 https://www.devze.com 2022-12-17 13:50 出处:网络
The session in my application often gets expired. session_gc_maxlifetime is set to 24 minutes(de开发者_StackOverflow社区fault);

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

精彩评论

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

关注公众号