Page 1 of 1

Lots of oc_session with data = false

Posted: Thu Sep 29, 2022 4:37 am
by opensource
Good day,

Version: 3.0.2.0

I have a lot of sessions in a table oc_session with column data = false. Can I just safely delete them? I believe these are useless and might be generated by some broken module. I have no other ideas.

('f49d848ff5b728e493954723d6', 'false', '2022-09-28 05:35:43'),
('f49d907600e81c66d630b6ab40', 'false', '2022-09-27 15:39:35'),
('f49d9aa8cc8834069a756c7aa2', 'false', '2022-09-28 05:56:25'),
('f49dbc467630834ff9b95f8e6e', 'false', '2022-09-24 23:22:24'),
('f49dca47e4977895ffca5e4020', 'false', '2022-09-23 00:31:52'),
('f49dcf75501f2b681094d7c637', 'false', '2022-09-24 08:16:42'),
('f49dd629b779a3afc301ad4aed', 'false', '2022-09-24 18:16:10'),
('f49dd95eb73ff515a3186deea5', 'false', '2022-09-26 18:09:21'),
('f49e062b9098e1b2e09a582ee6', 'false', '2022-09-26 16:45:51'),

Re: Lots of oc_session with data = false

Posted: Thu Sep 29, 2022 7:58 pm
by paulfeakins
There's a fix in later versions of OC, you can backport it if you know what you're doing.

If not, contact us and we can do it: info@antropy.co.uk

[Solved] Re: Lots of oc_session with data = false

Posted: Sat Nov 12, 2022 4:14 am
by jrr
paulfeakins wrote:
Thu Sep 29, 2022 7:58 pm
There's a fix in later versions of OC, you can backport it if you know what you're doing.

If not, contact us and we can do it: info@antropy.co.uk
I have 3.0.3.6 and have similar problems with oc_sessions. My repeating sessions are for apparently two extensions:
"{"language":"en-gb","currency":"CAD","eautoupdatess":true}"
and
"{"language":"en-gb","currency":"USD","abandonedCart_ID":"some random code here"}"

I'm getting four a minute or so...

Image

Not sure if this is the problem you are referring to Paul, or it is the extensions named...these extensions both have crontab calls, but the calls are just once a day.
I'm going to turn them both off and see what happens. Several extensions turned off but I'm still getting 4 calls a minutes - looks like it is Currency related...

Image


Can you provide a link to the github page about this issue you mention?

I believe this is the Sessions Not Expiring problem, after digging a bit further...

Thanks!

Re: Lots of oc_session with data = false

Posted: Sat Nov 12, 2022 7:43 am
by straightlight
jrr wrote:
Sat Nov 12, 2022 4:14 am
paulfeakins wrote:
Thu Sep 29, 2022 7:58 pm
There's a fix in later versions of OC, you can backport it if you know what you're doing.

If not, contact us and we can do it: info@antropy.co.uk
I have 3.0.3.6 and have similar problems with oc_sessions. My repeating sessions are for apparently two extensions:
"{"language":"en-gb","currency":"CAD","eautoupdatess":true}"
and
"{"language":"en-gb","currency":"USD","abandonedCart_ID":"some random code here"}"

I'm getting four a minute or so...

Image

Not sure if this is the problem you are referring to Paul, or it is the extensions named...these extensions both have crontab calls, but the calls are just once a day.
I'm going to turn them both off and see what happens. Several extensions turned off but I'm still getting 4 calls a minutes - looks like it is Currency related...

Image


Can you provide a link to the github page about this issue you mention?

I believe this is the Sessions Not Expiring problem, after digging a bit further...

Thanks!
I believe it's been fixed in the opencart-3 repository: https://www.github.com/opencart/opencart-3 .

[Solved] Re: Lots of oc_session with data = false

Posted: Sat Nov 12, 2022 9:55 am
by jrr
straightlight wrote:
Sat Nov 12, 2022 7:43 am
jrr wrote:
Sat Nov 12, 2022 4:14 am
paulfeakins wrote:
Thu Sep 29, 2022 7:58 pm
There's a fix in later versions of OC, you can backport it if you know what you're doing.

If not, contact us and we can do it: info@antropy.co.uk
...

I believe this is the Sessions Not Expiring problem, after digging a bit further...

Thanks!
I believe it's been fixed in the opencart-3 repository: https://www.github.com/opencart/opencart-3 .
Looks like Paul suggested fixing php.ini to help deal with this back in '17:

https://www.antropy.co.uk/blog/opencart ... illing-up/

Would adding the three variable he speaks of clear up both this and other issues with tmp files? I checked, and I already had it set to an hour:

Image

Well it was worth a look!

Re: Lots of oc_session with data = false

Posted: Sat Nov 12, 2022 6:22 pm
by JNeuhoff
If this still hasn't been fixed with above suggestions, your website might be subjected to a bruteforce attack. Check your server's raw access log.

Re: Lots of oc_session with data = false

Posted: Sat Nov 12, 2022 6:28 pm
by ADD Creative
Changing the setting won't help unless you apply the bug fixes.

Probably the easiest thing to do id to just to use the latest file from the 3.0.x.x Maintenance branch.
https://github.com/opencart/opencart/bl ... ion/db.php

Have you looked in your web access logs to see if you can spot the requests that cause your issue?

Re: Lots of oc_session with data = false

Posted: Mon Nov 14, 2022 10:40 am
by by mona
no problem there, a bot will create a new session on every request, they do not hold the session.
So, if googlebot or any other bot requests your pages, you will be creating many sessions, nothing wrong with that.

The language":"en-gb","currency":"USD","abandonedCart_ID"... are just session variables and their value.

It only becomes a problem when those session entries are not removed after they expire.

Re: Lots of oc_session with data = false

Posted: Mon Nov 14, 2022 6:07 pm
by JNeuhoff
The OP (opensource) hasn't responded since Sep 28, 2022. Hence we can assume that he's by now resolved this issue.

For others, I suggest to open a new forum thread when facing similar issues with an inflated oc_session DB table.

[Solved] Re: Lots of oc_session with data = false

Posted: Thu Nov 17, 2022 3:58 pm
by jrr
JNeuhoff wrote:
Mon Nov 14, 2022 6:07 pm
The OP (opensource) hasn't responded since Sep 28, 2022. Hence we can assume that he's by now resolved this issue.

For others, I suggest to open a new forum thread when facing similar issues with an inflated oc_session DB table.
[
SOLVED]
Just to close my problems with excessive oc_sessions in the DB.

It was all my fault.

I had set up the /storage directory with the wrong permissions - I used 700 instead of 755 - I was trying to hide the directory from the public.

The fix was simple:
  • leave an admin window open set to admin/extensions/modifications
  • then reset (just) the /storage directory permissions to 755
  • delete the /storage/modification directory
  • create an EMPTY /storage/modification directory,
  • then go to admin/extensions/modifications and do a refresh - note that when you refresh the storage/modification directory is rebuilt

oc-sessions are now being deleted as they should be once expired.

I'm using .htaccess to prevent access to my /storage directory (folks see a 403 error) and .htaccess & .htpasswd protection for my /admin directory. I've gone back to the /admin name because it seems to annoy some extensions to change the admin directory name.

John :-#)#

Re: Lots of oc_session with data = false

Posted: Thu Nov 17, 2022 7:10 pm
by paulfeakins
jrr wrote:
Thu Nov 17, 2022 3:58 pm
[
SOLVED]
Please put the [SOLVED] at the start of the post TITLE not of your post.

[Solved] Re: Lots of oc_session with data = false

Posted: Sat Nov 19, 2022 11:55 pm
by jrr
paulfeakins wrote:
Thu Nov 17, 2022 7:10 pm
jrr wrote:
Thu Nov 17, 2022 3:58 pm
[
SOLVED]
Please put the [SOLVED] at the start of the post TITLE not of your post.
I did not start the thread, all I can do is add [Solved] to my post's subject lines...

Re: [Solved] Re: Lots of oc_session with data = false

Posted: Sun Nov 20, 2022 3:08 am
by paulfeakins
jrr wrote:
Sat Nov 19, 2022 11:55 pm
paulfeakins wrote:
Thu Nov 17, 2022 7:10 pm
jrr wrote:
Thu Nov 17, 2022 3:58 pm
[
SOLVED]
Please put the [SOLVED] at the start of the post TITLE not of your post.
I did not start the thread, all I can do is add [Solved] to my post's subject lines...
Ah yes, no worries!