Darghon Posted June 24, 2013 Share Posted June 24, 2013 There are a lot of topics that explain how to change the session lifetime for a application but for some reason I'm to stupid to make it work, and can't for the life of me figure out why... I want to extend the lifetime of a session with 2 hours of inactivity. So that the session remains active upto 2 hours after the last action of the user. I've tried this with .htaccess setting the lifetime and maxlifetime to 7200 which killed the session after exactly 2 hours (Not what I wanted) Removing the maxlifetime setting results in the same effect. I've added the ini_set params for lifetime to the same, also without effect. I've added a setcookie function to each request to reset the lifetime of the session, with no success... what am I doing wrong? and are there any other ways to resolve this? Thanks to anyone for advice on this matter. Quote Link to comment https://forums.phpfreaks.com/topic/279509-changing-session-lifetime/ Share on other sites More sharing options...
mac_gyver Posted June 24, 2013 Share Posted June 24, 2013 setting the lifetime and maxlifetime to 7200 which killed the session after exactly 2 hours if the session was still active upto/before the 2 hour limit and the last access time was refreshed/updated when you accessed a page containing a session_start() statement, then that did exactly what you wanted. if that statement means something else, you would need to clarify what it did that wasn't what you wanted. it would also help if you showed the exact settings/code you tried in case there's something wrong with the usage. also, any chance that you executed a session_start() that didn't have the settings present before the session_start() statement, so that the default settings took effect? Quote Link to comment https://forums.phpfreaks.com/topic/279509-changing-session-lifetime/#findComment-1437646 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.