Support

Admin Tools

#33960 Session cleaner plugin not purging sessions

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Wednesday, 09 December 2020 20:17 CST

maestroc

I have a site that the session table fills up very fast on.  I was hoping to have the admin tools plugin clear it once each day.  I set the Enable Session Cleaner slider to Yes and set it to Run every 1440 minutes.  Saved and walked away.  Came back two days later and it does not seem to be clearing the session table.  It was almost 1gig in size when I came back to look.  Is there a log somewhere that shows what is going on and why the plugin isn't clearing that table the way I am expecting?

 

Photo attached showing my settings.  Plugin is enabled.

tampe125
Akeeba Staff

Hello,

thank you very much for the report, there was indeed a bug in the session purge feature, it was running only for backend user.

Please download the latest dev release and try again, it should fix your issue.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

maestroc

Excellent.  Thank you.  Can I ask one additional question on this?  If I set it to 1440 minutes and save that entry at midnight tonight will it always run at midnight or will it vary depending on how many people visit the site and at what times? 

If it will vary is there a way to force it to ONLY run between certain hours?  We don't want to risk having an editor get logged out in the middle of writing something.

tampe125
Akeeba Staff

Session cleaner is a "lazy" plugin: it fires only if enough time has passed and a visitor hits your site, so its timing is not very accurate.

However you should not worry about your using being logged out: we do not simply truncate the table, but we ask Joomla to perform garbage collection. This means that Joomla will remove all records from the table that refer to expired sessions, people that will have to authenticate anyway, but we delete the record to save space and keep the session table in good shape.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

maestroc

Can you clarify the difference between the Enable Session Optimiser and the Enable Session Cleaner option in the plugin?  I currently have the optimiser one turned on and set to run every 360 minutes and it does not seem to be helping much with keeping the session table size down.

If I turn on enable session cleaner does that one log people out?  If they were working on something when it runs will it allow them to save before making them log back in or will any changes be lost?

tampe125
Akeeba Staff

Session optimizer
It will run the command OPTIMIZE TABLE #__sessions on the database. This is useful only if you have your database engine set to MyISAM, otherwise it won't do much

Session cleaner
This will clear the session table from people whom session has already expired. Please note that right now table cleaning is performed randomly each time a visitor hits your page to avoid stressing the database too much (if I remember correctly there's a 1 in 5 chance to do such cleaning).
Running a cleaner will delete those logged out records on fixed intervals.

Please remember that Joomla will always create a session record even for guest users. If you have database issues caused by session table, I'd suggest you to do some research about switching the session table type to MEMORY or to use a different session provider such as Redis.

 

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!