Automatically deleted after 1 hour by default.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Sure?? I check session code:
After 1 Hours: session is destroy and generate new session id and insert new session in database. this true. But Old session Not Delete From Database after 1 hours. Please see my image test in Mamp localhost example:
https://pasteboard.co/Hw2IodY.png
U can see
2018-07-23
2018-07-24
2018-07-22
And New Session For Today 2018-07-25
OC Not Delete Old Session Data Form Database After Expire. and this problem when we have many many user request for website per day.
Thanks For Any Help.
After 1 Hours: session is destroy and generate new session id and insert new session in database. this true. But Old session Not Delete From Database after 1 hours. Please see my image test in Mamp localhost example:
https://pasteboard.co/Hw2IodY.png
U can see
2018-07-23
2018-07-24
2018-07-22
And New Session For Today 2018-07-25
OC Not Delete Old Session Data Form Database After Expire. and this problem when we have many many user request for website per day.
Thanks For Any Help.
Not sure about this solution but you can try this out
Create a backup of session table then perform a query that will delete the data till last month.
Since these sessions are already expired, so it should not create any issue.
Create a backup of session table then perform a query that will delete the data till last month.
Since these sessions are already expired, so it should not create any issue.
Opencart Expert | sales[at]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt
Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company
For 489000 Views in month ?! I delete manually ?! I think This Not Good Idea.ostechnologies wrote: ↑Wed Jul 25, 2018 7:31 pmNot sure about this solution but you can try this out
Create a backup of session table then perform a query that will delete the data till last month.
Since these sessions are already expired, so it should not create any issue.
You work with OC 3.0 ?! If Yes, Your Session Data Remove after 1 hours? If, No Whats your solution For Big Website?!
This wasn't considered before but I do realize a flaw in the validation here … the session table will only be cleared after one hour if the admin user uses the API with a requested route by having a valid IP address … however, it does not seem to validate whenever a session overall has exceeded one hour in order to free the database despite the API sessions or not since an admin user can simply interrupt his session without logging out from his account … besides, an API transaction should not usually an hour to complete its operation nor should the admin would require that mount of time to do so ...
Let's try the following to see if that will resolved the issue. In catalog/controller/startup/session.php file,
find:
add below:
This will still validate hourly. See if the session table does get cleared afterwards. You can also reduce the time period from: HOUR to MINUTE and 1 to let's say: 30 (30 mins). However, it would be more suggested to leave it as is with the hour period.
The only downside of this modification is the un-synchronous time period between the catalog and the admin user while using the session ID while the admin user uses the customer's account.
Let's try the following to see if that will resolved the issue. In catalog/controller/startup/session.php file,
find:
Code: Select all
$this->session->start($session_id);
Code: Select all
$this->db->query("DELETE FROM `" . DB_PREFIX . "api_session` WHERE TIMESTAMPADD(HOUR, 1, date_modified) < NOW()");
The only downside of this modification is the un-synchronous time period between the catalog and the admin user while using the session ID while the admin user uses the customer's account.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 12 guests