? ? Failure

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
21 Dec 2016

Summary of Changes

This should in full decouple the requirement for session metadata. It's done by adding a new global configuration switch (default on because B/C) that when switched off features dependent on this data will need to check. Plus, some other tweaks squeezed in while testing stuff.

Summary of change:

  • New config field, if switching off metadata then the config model will also purge what data we have
  • Features dependent on session metadata adjusted:
    • Joomla\CMS\Application\CMSApplication::afterSessionStart() does not run the code to write or cleanup metadata when disabled
    • Admin mod_logged module shows a message if metadata is disabled versus a list of users
    • Admin mod_status module hides site/admin user counts if metadata is disabled
    • Site mod_whosonline module shows a message if metadata is disabled versus a count of users
    • PlgUserJoomla only interacts with the session data when the environment is set for it
    • Joomla\CMS\Table\Table::isCheckedOut() modified to account for the metadata tracking
  • Added fields to configure Redis session handler
  • Removed fields to configure the now unsupported Memcache session handler
  • Joomla\CMS\Application\CMSApplication::afterSessionStart() will no longer cause an application fatal error if writing the session metadata fails; either it'll fail again when writing the at the end of the request (if using the database handler) and the session fails to persist or the user isn't using the database handler and it really doesn't matter anyway

Testing Instructions

With this patch applied over the 4.0 branch, it should be possible to turn off writing session related metadata to the database. When using a non-database handler, the session table should always stay empty. Switching this off when enabled should clear existing metadata.

Documentation Changes Required

Note that it'll be possible for data to not always be persisted into the database, namely the session ID, client, user ID, and username. When enabled, this will cause the checked out checks to not be able to determine if a user is still logged in.

avatar mbabker mbabker - open - 21 Dec 2016
avatar mbabker mbabker - change - 21 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Dec 2016
Category Administration com_config Language & Strings Modules Installation Libraries Front End Plugins
avatar mbabker mbabker - change - 21 Dec 2016
Labels Added: ? ?
avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Added:
avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Added:
avatar mbabker
mbabker - comment - 27 Sep 2017

Is this worth my time to pursue rebasing?

avatar brianteeman
brianteeman - comment - 27 Sep 2017

Sorry i didnt test this as i didnt understand it and others have repeatedly stated that only experienced developers should test library changes. if only those same people would actually do that :(

avatar mbabker
mbabker - comment - 28 Sep 2017

Well it is kind of technical in nature, and it also affects user facing features. So a mix of both would be helpful. But I'm really not interested in fighting with 9 months of merge conflicts if it's going to sit around.

avatar joomdonation
joomdonation - comment - 26 Dec 2017

Just want to add that if people agree with the missing features when session meta data is turned off, I can test and review this PR once conflict resolved

avatar brianteeman
brianteeman - comment - 4 Jan 2018

@mbabker looks like if you resolve the cconflicts there are at least two of us prepared to test

avatar mbabker
mbabker - comment - 5 Jan 2018

OK this should be good to go.

avatar brianteeman
brianteeman - comment - 5 Jan 2018

When using a non-database handler, the session table should always stay empty. Switching this off when enabled should clear existing metadata.

It clears the metadata field but leaves the record with the session_id - is that correct?

avatar brianteeman brianteeman - test_item - 5 Jan 2018 - Tested successfully
avatar brianteeman
brianteeman - comment - 5 Jan 2018

I have tested this item successfully on b2dab59

Other than my question above everything still works as i would expect it to work and the module changes work as described etc


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

avatar mbabker
mbabker - comment - 5 Jan 2018

It clears the metadata field but leaves the record with the session_id - is that correct?

Correct. The session related fields that are tracked are the session ID, time, and data.

avatar brianteeman
brianteeman - comment - 5 Jan 2018

All seems good to me then

avatar joomdonation
joomdonation - comment - 5 Jan 2018

It works for me, too. Just an issue with Session Save Path setting:

  1. Might be a problem with path filter but when I enter a windows path like D:\www\sessiondata , it could not be saved

  2. I guess you need to add some validation to the path to make sure it exists (like other paths). When a wrong path is entered, the application could not be started, an error like this displayed:

Warning: mkdir(): No such file or directory in D:\www\joomla4\libraries\vendor\joomla\session\src\Handler\FilesystemHandler.php on line 55
Error displaying the error page: A \Joomla\Session\SessionInterface object has not been set.: Could not create session directory "/home/abc"

avatar brianteeman
brianteeman - comment - 5 Jan 2018

@joomdonation - enter the wrong data and you get an error message telling you that - seems fine to me.
Pretty sure that this is nothing to do with this PR though and as such is out of scope here.

avatar joomdonation
joomdonation - comment - 5 Jan 2018

I'm not getting error. The path is saved to configuration.php and then the application could not be stared like I said

avatar brianteeman
brianteeman - comment - 5 Jan 2018

thats what I meant. You are getting the error (just not immediately).

BUT if this happened before this PR then it is out of scope and you should create a new issue if you feel it is wrong

avatar joomdonation
joomdonation - comment - 5 Jan 2018

Here is the screenshot after I entered a wrong path and save configuration, the site is completely broken:
application_error

avatar joomdonation
joomdonation - comment - 5 Jan 2018

I read description of the PR and thought this is included:

Added field to configure the file path if using the file session handler

But you are correct, look like that setting was introduced before this PR

avatar mbabker mbabker - change - 5 Jan 2018
The description was changed
avatar mbabker mbabker - edited - 5 Jan 2018
avatar mbabker
mbabker - comment - 5 Jan 2018

Adding that setting was once in scope of this PR but at some point it got added to the repo separately, removed that note from the main description as the diff clearly shows that setting isn't being touched here now.

avatar mbabker mbabker - change - 5 Jan 2018
The description was changed
avatar mbabker mbabker - edited - 5 Jan 2018
avatar joomdonation joomdonation - test_item - 5 Jan 2018 - Tested successfully
avatar joomdonation
joomdonation - comment - 5 Jan 2018

I have tested this item successfully on b2dab59


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Jan 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Jan 2018

Ready to Commit after two successful tests.

avatar mbabker
mbabker - comment - 14 Feb 2018

No longer interested in pursuing correct session architecture in Joomla. Bye.

avatar mbabker mbabker - close - 14 Feb 2018
avatar mbabker mbabker - change - 14 Feb 2018
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2018-02-14 14:06:36
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - change - 14 Feb 2018
Status Closed New
Closed_Date 2018-02-14 14:06:36
Closed_By mbabker
Labels Removed: ?
avatar mbabker mbabker - change - 14 Feb 2018
Status New Pending
avatar mbabker mbabker - reopen - 14 Feb 2018
avatar tonypartridge
tonypartridge - comment - 5 Apr 2018

Where are we with this? I see we got two successful tests but no merge and now conflicts?

avatar mbabker
mbabker - comment - 10 Apr 2018

Rebased. See y'all at the next merge conflict ?

avatar laoneo laoneo - close - 11 Apr 2018
avatar laoneo laoneo - merge - 11 Apr 2018
avatar laoneo laoneo - change - 11 Apr 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-04-11 06:35:16
Closed_By laoneo

Add a Comment

Login with GitHub to post a comment