Rwe Posted October 11, 2018 Share Posted October 11, 2018 I have the issue that the sessions in the sessions table are not being cleared so it gets larger and larger . Now it is the largest table in my DB. I already manual cleared the table before but this is not the way is should be. How can i fix it to make the expired sessions automaticly being cleared in includes/functions/sessions.php ? installed version: osCommerce Online Merchant v2.3.4.1 CE Frozen PHP 7.2 session.gc_maxlifetime 1440 Link to comment Share on other sites More sharing options...
MrPhil Posted October 11, 2018 Share Posted October 11, 2018 You may want to do a search on "session table" (including the quotes) for more discussion on this. There is a Database Optimizer add-on: that removes old sessions. That might be useful for you. Link to comment Share on other sites More sharing options...
puddlec Posted October 12, 2018 Share Posted October 12, 2018 I had a problem when i first moved to PHP 7.X, that the sessions table would not clear, after some digging i noticed that my session.gc_probability was set to 0 you can see what it is set to by checking your server info within tools. then just scroll down or search for it. to fix it i just set session.gc_probability to 1 by putting/changing session.gc_probability = 1 in my php.ini file Phoenix support now at https://phoenixcart.org/forum/ App created for phoenixTinyMCE editor for admin Link to comment Share on other sites More sharing options...
Rwe Posted October 12, 2018 Author Share Posted October 12, 2018 Hi, Yes you are right, session.gc_probability is set to 0 But i am on a shared server with no access to the php.ini Can session.gc_probability = 1 be set in .htaccess too? 36 minutes ago, puddlec said: to fix it i just set session.gc_probability to 1 Link to comment Share on other sites More sharing options...
puddlec Posted October 12, 2018 Share Posted October 12, 2018 did a quick test on my local install, and i put the following at the bottom of my .htaccess file php_value session.gc_probability 1 Phoenix support now at https://phoenixcart.org/forum/ App created for phoenixTinyMCE editor for admin Link to comment Share on other sites More sharing options...
MrPhil Posted October 12, 2018 Share Posted October 12, 2018 You can try putting a php_value setting in your .htaccess file, but most servers these days will barf with a 500 error. If that happens, talk to your host's tech support to see what you can do about either setting up a php.ini file, or the equivalent (such as user.ini). They've got to have some means of letting you set PHP settings. Link to comment Share on other sites More sharing options...
Jack_mcs Posted October 12, 2018 Share Posted October 12, 2018 4 hours ago, Rwe said: Yes you are right, session.gc_probability is set to 0 Enabling that is not recommend. The php developers say that if you are going to use it, it should be done via a cron job that runs periodically instead of each time as it will if you change the setting. They also state it may not reliably handle the sessions based on the traffic. See here. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Rwe Posted October 12, 2018 Author Share Posted October 12, 2018 37 minutes ago, Jack_mcs said: Enabling that is not recommend Ok just when i found out how to enable that in .htaccess and php 7.2 without getting server errors Better not to enable it then. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.