Bottyz Posted March 23, 2011 Share Posted March 23, 2011 Hi all, I'm trying to increase the server default php session timeout from 1hour to 3hours. I don't have access to my php.ini but can use .htaccess. Is the following the correct way to do this? in the .htaccess add the line: php_value session.gc_maxlifetime 10800 Or would I be better off including the following after every session start() on everypage: ini_set("session.gc_maxlifetime","10800"); thanks! Quote Link to comment https://forums.phpfreaks.com/topic/231499-is-this-the-best-way-to-extend-the-php-session-time/ Share on other sites More sharing options...
lbh2011 Posted March 23, 2011 Share Posted March 23, 2011 The idea of putting it into your script would be best. Could I suggest that you put it into config.php or where you define you server settings, then you don't need to put it on each and every page as it would be included each time. Quote Link to comment https://forums.phpfreaks.com/topic/231499-is-this-the-best-way-to-extend-the-php-session-time/#findComment-1191355 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.