Eggzorcist Posted July 26, 2009 Share Posted July 26, 2009 I'm developing an application which may have have a person on the same page writting something for quite a long period of time. I was wondering as my security is set up with sessions could these sessions die by the time you'd finish the form? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/ Share on other sites More sharing options...
.josh Posted July 26, 2009 Share Posted July 26, 2009 yes. Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-882984 Share on other sites More sharing options...
Third_Degree Posted July 26, 2009 Share Posted July 26, 2009 Yes, they potentially could. I think to fix it you'll need to edit session_timeout with ini_set() Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-882985 Share on other sites More sharing options...
Eggzorcist Posted July 28, 2009 Author Share Posted July 28, 2009 the session_timeout is in php.ini? also is there any alternative which could fix this issue? Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-884681 Share on other sites More sharing options...
waynew Posted July 28, 2009 Share Posted July 28, 2009 You could use Ajax to keep saving drafts of what they're typing. Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-884697 Share on other sites More sharing options...
patrickmvi Posted July 28, 2009 Share Posted July 28, 2009 Another solution would be to somehow automatically re-establish their session when they would submit the form if it has expired using a cookie or get variable to keep track of who they are. Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-884845 Share on other sites More sharing options...
aschk Posted July 28, 2009 Share Posted July 28, 2009 I believe you can set certain php.ini values using .htaccess or your virtual host config (depending on hosting limitations). You can also try doing the following in your code: <?php ini_set("session.gc_maxlifetime", 7200); ?> Assuming their session times out, when they submit their post would you require them to log in again? If that's the case then i'm guessing you redirect them to a login page. What you need to do is create a new session for them using their old session cookie value, save their post data (in session), and process their login and then post in the same step. Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-884931 Share on other sites More sharing options...
PFMaBiSmAd Posted July 28, 2009 Share Posted July 28, 2009 My favorite subject, sessions. On a shared web host where the common default location is used for the session save path, the shortest session.gc_maxlifetime setting of all the scripts running on the server wins. To get a longer session.gc_maxlifetime setting to work, you must set the session save path setting to be to a private folder within your account's folder tree. Quote Link to comment https://forums.phpfreaks.com/topic/167454-quick-sessions-question/#findComment-885166 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.