searls03 Posted April 29, 2011 Share Posted April 29, 2011 is there anyway to prevent a sessions from expiring to soon. I believe they are 20 minute sessions, correct. Even if they are not 20 min. is there a way to prevent it from happening? Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/ Share on other sites More sharing options...
fugix Posted April 29, 2011 Share Posted April 29, 2011 you can set the global value for session cleanup higher than the default 24 minutes in your php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208297 Share on other sites More sharing options...
fugix Posted April 29, 2011 Share Posted April 29, 2011 or you can use ini_set("session.gc_maxlifetime", "18000"); which will increase the max lifetime of a session to whatever time you set. However I believe that this script must be placed in every file that you wish to increase the expiration time on Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208300 Share on other sites More sharing options...
searls03 Posted April 29, 2011 Author Share Posted April 29, 2011 is there supposed to be a php.ini file? Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208305 Share on other sites More sharing options...
fugix Posted April 29, 2011 Share Posted April 29, 2011 yes it comes with your php5 download..it is normally found in this path.../etc/php5/php.ini Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208306 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 is there a way to set sessions to expire after a time of inactivity, not activity? Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208523 Share on other sites More sharing options...
trq Posted April 30, 2011 Share Posted April 30, 2011 is there a way to set sessions to expire after a time of inactivity, not activity? That is how they currently work. Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208525 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 is there a way to set sessions to expire after a time of inactivity, not activity? That is how they currently work. That's not how it is on mine. Mine just randomly logs out in the middle of doing something. Even when there is Activity. By the way, my php.ini file is not accessible. On my host it is a server file that would affect all websites that use their server. Quote Link to comment https://forums.phpfreaks.com/topic/235108-session-expiration/#findComment-1208623 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.