RTC bug PR-5.4-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

avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 5.4-dev.

avatar alikon alikon - change - 18 Oct 2025
Labels Added: bug
avatar alikon alikon - change - 26 Oct 2025
Labels Added: PR-5.4-dev
Removed: PR-5.3-dev
avatar muhme muhme - change - 26 Oct 2025
Title
[5.3] Task SessionGC delete metadata from db
[5.4] Task SessionGC delete metadata from db
avatar muhme muhme - edited - 26 Oct 2025
avatar ceford
ceford - comment - 3 Nov 2025

Could you clarify the testing instructions?

I don't have a "System - Session Garbage Collector" plugin.

Schedule the com_plugins.task.sessiongc task using Joomla Scheduler - does that mean go to Scheduled Tasks and edit the Ssssion GC task? The Advanced tab has Logging disabled and Task Success disabled.

My session table only has entries for today so I am unsure how to accumulate entries for a few days. Am I supposed to turn off Enable Session Data Cleanup?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46128.
avatar muhme muhme - test_item - 7 Nov 2025 - Tested successfully
avatar muhme
muhme - comment - 7 Nov 2025

I have tested this item ✅ successfully on 2a12605

Tested with JBT, before PR graft nightly build,

  • 'Task - Session Data Purge' plugin is already enabled
  • Enabled 'Session Handler' 'Database' and configured 'Session Lifetime' 3 minutes
  • Configured 'Session GC' to run 24 hours execution interval
  • Used multiple times private windows to create new sessions and waited > 3 minutes
  • php cli/joomla.php scheduler:run -i 2 (ID 2 is 'Session GC')
  • Seen database entries are not reduced
  • Backend: 'Run Test' of 'Session GC' and seen entries are reduced

Applied PR with Patch Tester

  • Used multiple times private windows to create new sessions and waited > 3 minutes
  • php cli/joomla.php scheduler:run -i 2
  • ✅ Seen database entries are reduced
  • Used multiple times private windows to create new sessions and waited > 3 minutes
  • ✅ Backend: 'Run Test' of 'Session GC' and seen entries are reduced
  • Used multiple times private windows to create new sessions
  • ✅ Immediately running php cli/joomla.php scheduler:run -i 2 -> database entries are not reduced
  • ✅ Immediately 'Run Test' of 'Session GC' -> database entries are not reduced
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46128.
avatar muhme
muhme - comment - 7 Nov 2025

Could you clarify the testing instructions?

@ceford Perhaps my test notes help? Or today 15:00 UTC is PR testing time 😄

avatar ceford ceford - test_item - 7 Nov 2025 - Tested successfully
avatar ceford
ceford - comment - 7 Nov 2025

I have tested this item ✅ successfully on 2a12605

The test notes from @muhme helped!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46128.

avatar muhme muhme - change - 7 Nov 2025
Status Pending Ready to Commit
avatar muhme
muhme - comment - 7 Nov 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46128.

avatar richard67 richard67 - change - 8 Nov 2025
Labels Added: RTC
avatar richard67 richard67 - change - 8 Nov 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-11-08 11:45:04
Closed_By richard67
avatar richard67 richard67 - close - 8 Nov 2025
avatar richard67 richard67 - merge - 8 Nov 2025
avatar richard67
richard67 - comment - 8 Nov 2025

Thanks @alikon for this bug fix, @joomdonation for review, and @ceford and @muhme for testing.

avatar XavierNosyweb
XavierNosyweb - comment - 24 Nov 2025

Hi,

I'm just a basic user (not developper) and I had to disable the 2 other tasks to make the session gc worging (clicking on "Run test" or "Exécuter le test" in French). I enclose an image.
I would appreciate if someone could let me know (for a basic user) how to set the command php cli/joomla.php scheduler:run -i 2 (in which file? is it between ...)

Regards.

Xavier


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46128.

Add a Comment

Login with GitHub to post a comment