Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

session db table is getting very large


Rwe

Recommended Posts

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

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 phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...