Page 1 of 1
Sessions table
Posted: Wed Mar 31, 2021 8:13 am
by alix32
Hi - my sessions table is filling up quite quickly. While I do have sufficient space to carry on for a while, what would be the impact to wiping out some of that stored data? Returning visitors who had items to their cart may not see their "carted" items any more? Trying to size the impact before I do anything bad
Thanks!
Re: Sessions table
Posted: Wed Mar 31, 2021 11:09 am
by ecartz
By default, all sessions that are older than maxlifetime are supposed to get cleared whenever the garbage collector runs. See
https://github.com/CE-PhoenixCart/Phoen ... ns.php#L45
If the garbage collector settings from php.ini are not working correctly, it should be harmless to run
Code: Select all
DELETE FROM sessions WHERE expiry < NOW() - INTERVAL 1 WEEK
in phpMyAdmin or wherever. This is supposed to happen on some regular basis. It shouldn't affect returning visitors, as they should get new session IDs regardless. The problematic deletion would be visitors who currently have their browser open. Hopefully there aren't that many visitors who have their browser open for more than a week between visits.
Because the database date and the server date may be different, I don't know that it would be a good idea to set the interval to less than 3 DAY. 1 WEEK or 1 MONTH or 1 YEAR should be fine. You might try starting with the longest interval and seeing how much that helps. You can then decrease down step-by-step to a week if not.
Re: Sessions table
Posted: Thu Apr 01, 2021 5:10 pm
by Omar_one
there is add-on (Session Expiration Control) made for older version of Community Bootstrap Edition (BS Edge) by Demitry , to allows the store owner to manage their admin panel's session expiration, as well as the customer's session expiration via Admin>Configuration>Sessions.
I didn't test on Phoenix also it's need some core change,,
Re: Sessions table
Posted: Tue Dec 10, 2024 5:59 pm
by GdNico
Hi everyone,
now that there is no longer $maxlifetime or even _sess_gc() in the functions (at first sight since 1.0.9?) and that the core moved to a class "session", how are the sessions deleted ?
I post the question because I have just been forced to delete 1.6 GB in the table "sessions" (knowing that my database does not exceed 100MB ...)
thanks a lot for all
Re: Sessions table
Posted: Tue Jan 07, 2025 10:42 am
by heatherbell
GdNico wrote: ↑Tue Dec 10, 2024 5:59 pm
now that there is no longer $maxlifetime or even _sess_gc() in the functions (at first sight since 1.0.9?) and that the core moved to a class "session", how are the sessions deleted ?
As in previous post (read the whole post for detailed instructions):
ecartz wrote: ↑Wed Mar 31, 2021 11:09 am
By default, all sessions that are older than maxlifetime are supposed to get cleared whenever the garbage collector runs.
The function moved in v1.0.8.3 to:
https://github.com/CE-PhoenixCart/Phoen ... hp#L24-L27
where session.gc_maxlifetime is set in php.ini, usually default of 1440 seconds (24 minutes).
It might not be possible to see or change that value on a hosted server cPanel.
It is possible to check the current session.gc_maxlifetime setting by running this in a PHP script:
Code: Select all
echo ini_get('session.gc_maxlifetime');
Otherwise check with the hosted server provider.
Re: Sessions table
Posted: Tue Jan 07, 2025 11:40 pm
by MyGamesShop
I posted about this here:
viewtopic.php?f=10&t=2235
I have installed Zip's firewall which has assisted a fare bit in identifying and stopping bad actors.
I then promote these IP bans to a real firewall in place to handle Amazon's Claudebot however
as the IP bans are now in the millions.