? Pending

User tests: Successful: Unsuccessful:

avatar chrBrd
chrBrd
20 Nov 2016

Regardless of the session storage handler used the database session table is cleared based on the result of a modulo operation in JApplicationCms::loadSession(). When using the database for session storage the table is therefore likely be cleared far more often than per the PHPRC gc_ settings, resulting in unnecessary operations. It also renders the database storage handler's gc() method a little redundant and potentially breaks custom handler gc() methods that utilise session table data prior to their deletion.

Summary of Changes

Amended JApplicationCms::loadSession() so that it won't remove expired sessions from the database when the database storage handler is being used; they will instead be removed only on execution of JSessionStorageDatabase::gc().

Testing Instructions

  • Set the PHPRC so garbage collector runs on every execution.
  • Set the session lifetime in Joomla's config to a short duration.
  • Populate the #__session table.
  • After the created sessions' lifetimes have expired confirm the expired sessions are not removed from the #__session table on execution of JApplicationCms::loadSession() but on execution of JSessionStorageDatabase::gc().
  • Switch the session handler to anything other than 'Database' in Joomla's config.
  • Populate the #__session table again.
  • After the created sessions' lifetimes have expired confirm the expired session are removed in JApplicationCms::loadSession() if the result of the modulo operation is not 0.

Documentation Changes Required

None

avatar chrBrd chrBrd - open - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Nov 2016
Category Libraries
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
Labels Added: ?
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar chrBrd chrBrd - change - 20 Nov 2016
The description was changed
avatar chrBrd chrBrd - edited - 20 Nov 2016
avatar mbabker
mbabker - comment - 14 Feb 2018

This was actually changed as part of #19165 but it has been demanded to be reverted. So this PR can not be accepted sadly.

avatar mbabker mbabker - change - 14 Feb 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-02-14 14:07:46
Closed_By mbabker
avatar mbabker mbabker - close - 14 Feb 2018

Add a Comment

Login with GitHub to post a comment