The session in my application often gets expired.
session_gc_maxlifetime is set to 24 minutes(default);
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_maxlifetimeis 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().