Post by sandeepmishra83 » Sat Dec 23, 2017 8:24 pm

Hi i am using opencart 3.0.2.0.. what is use of session table data. can i delete this data.
will it create any issue further or old orders/customer details will be changed.


Posts

Joined
Thu Nov 23, 2017 10:34 am

Post by straightlight » Sat Dec 23, 2017 10:39 pm

I would not suggest to manually truncate the session data. There's already an hourly set interval period to handle the sessions from the core.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by fairmount » Sun Feb 18, 2018 12:18 pm

Hi,

Can I ask which part of the code handles this hourly clearance? OR is there a setting in Admin? The number of records in my OC3 session table is over 100,000 and I get only three or four visitors per day and this is over a span of just 3 months.

The site is really slow with just OC3, Journal, Openstock and vqmod installed.

Thanks.

Newbie

Posts

Joined
Fri Apr 20, 2012 11:42 am

Post by straightlight » Sun Feb 18, 2018 10:53 pm

Use TextCrawler to track lines of codes in OC. You don't need to ask the forum for these types of inquiry.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by fairmount » Mon Feb 19, 2018 6:32 am

Hi Straightlight,

Thanks for the response. If I know which code to search for, I would have. I do not know which part of code within OC manages the session data database to search and hence the question. Apologies if this seems obvious, just a newbie here.

I am presuming that some part of php code within OC will go through the session table in the database and clear all the old ones. Correct me if wrong. I want to know which file within OC, Or part of the code within OC handles this os that I can check if that bit is correct in my setup.

I use use GrepWin for searching within OC, is textcrawler better than this? Will give it a go anyway.

Regards,
KG

Newbie

Posts

Joined
Fri Apr 20, 2012 11:42 am

Post by d3z1gnr » Fri May 11, 2018 7:59 am

How did you go KG? Was looking at this subject myself this morning.

fairmount wrote:
Mon Feb 19, 2018 6:32 am
Hi Straightlight,

Thanks for the response. If I know which code to search for, I would have. I do not know which part of code within OC manages the session data database to search and hence the question. Apologies if this seems obvious, just a newbie here.

I am presuming that some part of php code within OC will go through the session table in the database and clear all the old ones. Correct me if wrong. I want to know which file within OC, Or part of the code within OC handles this os that I can check if that bit is correct in my setup.

I use use GrepWin for searching within OC, is textcrawler better than this? Will give it a go anyway.

Regards,
KG

Mike Little
Director / Developer / Makes the coffee
Creative Digital Limited
http://www.creativedigital.co.nz


User avatar
Active Member

Posts

Joined
Mon Jan 18, 2010 2:59 pm
Location - Auckland, New Zealand

Post by exit15 » Thu Jun 28, 2018 11:44 pm

Running 3.0.2.0 I had 450,000 records in one website and 1 MM lines in another. So I made a copy and truncated the table just to see what happens . Everything is working just fine. The question is weather the hourly cleanup process is in fact working. Clearly there are expired session records in the table. Any Idea??

New member

Posts

Joined
Sun Mar 03, 2013 2:05 am


Post by nongetjie » Mon Dec 17, 2018 4:18 am

fairmount wrote:
Sun Feb 18, 2018 12:18 pm
Hi,

Can I ask which part of the code handles this hourly clearance? OR is there a setting in Admin? The number of records in my OC3 session table is over 100,000 and I get only three or four visitors per day and this is over a span of just 3 months.

The site is really slow with just OC3, Journal, Openstock and vqmod installed.

Thanks.
Hi, did you ever find a solution for this? I'm experiencing this right now :-(

New member

Posts

Joined
Wed Nov 07, 2012 8:28 pm

Post by nongetjie » Mon Dec 17, 2018 4:18 am

exit15 wrote:
Thu Jun 28, 2018 11:44 pm
Running 3.0.2.0 I had 450,000 records in one website and 1 MM lines in another. So I made a copy and truncated the table just to see what happens . Everything is working just fine. The question is weather the hourly cleanup process is in fact working. Clearly there are expired session records in the table. Any Idea??
Hi did you find a solution for this?

New member

Posts

Joined
Wed Nov 07, 2012 8:28 pm

Post by exit15 » Sun Dec 30, 2018 3:51 am

I did not. If fact it is a bug (check github). The system simply does not delete old session and as a result there are thousands of OC databases inflated with millions of expired records in the 'session' table. For the time being every week or so I manually delete an avg of 150,000 records with this query:

"delete from `session` where `session`.expire < DATE_SUB(NOW(), INTERVAL 1 DAY);" (Removes everything older than 1 DAY, you can write '3 HOURS' if you prefer)

Daniel suggested a few fixes when alerted to the issue, but they did not work for me because the code on github is very different than the official distribution and every-time I copied a file that he changed to resolve this problem, it created a new problem. I am not a programmer, but i wish we could just plug the above query somewhere and simply delete old sessions

New member

Posts

Joined
Sun Mar 03, 2013 2:05 am


Post by rpmb » Sun Jan 13, 2019 6:56 pm

exit15 wrote:
Sun Dec 30, 2018 3:51 am
I did not. If fact it is a bug (check github). The system simply does not delete old session and as a result there are thousands of OC databases inflated with millions of expired records in the 'session' table. For the time being every week or so I manually delete an avg of 150,000 records with this query:

"delete from `session` where `session`.expire < DATE_SUB(NOW(), INTERVAL 1 DAY);" (Removes everything older than 1 DAY, you can write '3 HOURS' if you prefer)

Daniel suggested a few fixes when alerted to the issue, but they did not work for me because the code on github is very different than the official distribution and every-time I copied a file that he changed to resolve this problem, it created a new problem. I am not a programmer, but i wish we could just plug the above query somewhere and simply delete old sessions
Thanks for this. I used the sql query you posted and used it to create a php script out of the public_html directory and then set a cron job to run it daily removing old sessions. Seemed to be the easiest automated way to prune the sessions.

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by thbr02 » Sat Mar 02, 2019 1:46 am

rpmb wrote:
Sun Jan 13, 2019 6:56 pm
exit15 wrote:
Sun Dec 30, 2018 3:51 am
I did not. If fact it is a bug (check github). The system simply does not delete old session and as a result there are thousands of OC databases inflated with millions of expired records in the 'session' table. For the time being every week or so I manually delete an avg of 150,000 records with this query:

"delete from `session` where `session`.expire < DATE_SUB(NOW(), INTERVAL 1 DAY);" (Removes everything older than 1 DAY, you can write '3 HOURS' if you prefer)

Daniel suggested a few fixes when alerted to the issue, but they did not work for me because the code on github is very different than the official distribution and every-time I copied a file that he changed to resolve this problem, it created a new problem. I am not a programmer, but i wish we could just plug the above query somewhere and simply delete old sessions
Thanks for this. I used the sql query you posted and used it to create a php script out of the public_html directory and then set a cron job to run it daily removing old sessions. Seemed to be the easiest automated way to prune the sessions.
Would you mind share the script? I'm in the same situation and it would be nice solving it with cron.

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden
Who is online

Users browsing this forum: Hillbilly57 and 19 guests