pascal_22 Posted October 30, 2012 Share Posted October 30, 2012 Hello all, I read so much about it today and now i'm lost! I have a problem in somes pages of my website. For example, When a user registered on my web site, it redirect to a page to complete their profile, age, sexe, hubby,activity, and the user should enter a description in their word minimum 100 charactors... Sometime a user can stay in this page over than 30 minutes ..... so when they click on the button to save/create their profile, it's stop working because the max time for var session is reach, so the user is logged out automaticly and all the profile is lost.... so he/she needs to log in and do it again faster.... In read that by default, the time is set to 24 minutes.... how can i change it for 30 minutes or 40 minutes. Note that is inactive time.... the user is typing his description but he seam to enter in the inactive time.... How can i change it ? Thanks a lot!! Pascal Quote Link to comment https://forums.phpfreaks.com/topic/270084-how-to-set-the-var-session-max-time/ Share on other sites More sharing options...
kicken Posted October 30, 2012 Share Posted October 30, 2012 Note that is inactive time.... the user is typing his description but he seam to enter in the inactive time.... The server only knows if a user is active or not by receiving requests from them. Even if someone is actively doing something on your page (typing a bunch, playing some game, reading whatever) if there are no requests being sent to the server they are going to be considered inactive. In read that by default, the time is set to 24 minutes.... how can i change it for 30 minutes or 40 minutes. The setting that controls how old a session has to be before it can be deleted is session.gc_maxlifetime. You can set this in your php.ini file or using ini_set prior to calling session_start(). Quote Link to comment https://forums.phpfreaks.com/topic/270084-how-to-set-the-var-session-max-time/#findComment-1388847 Share on other sites More sharing options...
Christian F. Posted October 30, 2012 Share Posted October 30, 2012 Another option is to use a AJAX call to periodically check in with the server, and thus keep the session alive for those pages. Quote Link to comment https://forums.phpfreaks.com/topic/270084-how-to-set-the-var-session-max-time/#findComment-1388865 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.