PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
19 Sep 2025

Pull Request for Issue #45637 , #45032.

Summary of Changes

delete metadata from db too

Testing Instructions

  1. Set up a Joomla 5.x site with session handler set to "database"
  2. Enable the "System - Session Garbage Collector" plugin
  3. Schedule the com_plugins.task.sessiongc task using Joomla Scheduler
  4. Set the task to run daily via CLI using:
  5. php cli/joomla.php scheduler:run --all
  6. Let the session table grow over time with inactive sessions
  7. Check the number of records in the #__session table
  8. Now manually execute the same task via the Joomla backend (Scheduler > Tasks > Execute now)
  9. Check the #__session table again

Actual result BEFORE applying this Pull Request

When executed via the backend, the task successfully removes expired sessions.
When executed via CLI, the task is marked as "Completed" in the execution log, but expired session records remain in the database the session cleanup does not occur.

Expected result AFTER applying this Pull Request

Expired session records (older than the configured lifetime) are removed from the #__session table both when:

The task is executed via the backend
The task is executed via the CLI (cron)

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar alikon alikon - open - 19 Sep 2025
avatar alikon alikon - change - 19 Sep 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Sep 2025
Category Front End Plugins
avatar alikon alikon - change - 22 Sep 2025
Labels Added: PR-5.3-dev
5d56b08 22 Sep 2025 avatar alikon cs
avatar joomdonation
joomdonation - comment - 22 Sep 2025

Sorry @alikon. Thinking more about it, this still does not work properly with the combination of following conditions:

  • Task is executed via web
  • Session Handler is Database
  • Enable Session Data Cleanup parameter in the task set to No

To make it works for every possible cases, the if condition will be more complicated, difficult to understand for a very little benefit, so after thinking for a while, I think it will be best to restore the code to your original commit. Could you please do that? Sorry for the inconvenience.

avatar alikon
alikon - comment - 23 Sep 2025

I think it will be best to restore the code to your original commit. Could you please do that? Sorry for the inconvenience.

@joomdonation yes done and don't worry it is always better to have another couple of eyes

Add a Comment

Login with GitHub to post a comment