67637[BUGFIX] Keep session object in sync with session storage values
Commit message
Review
-
Code review CR +2 Done
- Oliver Hader +2
- Markus Klein +1
-
Verified V +2 Done
- Oliver Hader +2
- Laurent Foulloy +1
- Markus Klein +1
- core-ci +1 CI
Issues 2
Files 5
- typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php2+2 −2
- typo3/sysext/core/Classes/Session/UserSessionManager.php2+31 −7
- typo3/sysext/core/Tests/Unit/Session/UserSessionManagerTest.php+49 −0
- typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php+3 −3
- typo3/sysext/frontend/Tests/Unit/Authentication/FrontendUserAuthenticationTest.php+1 −1
Review log 4463
Show 2338 earlier messages
-
Ralf Zimmermann uploaded patch set 1 02/03/21, 16:29
-
TYPO3com voted on patch set 1 V +1 02/03/21, 16:36 Completed build in 07m 03s on Wed, 3 Feb, 04:36 PM Test Summary: 32585 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9217
-
Markus Klein commented on patch set 1 02/03/21, 22:40
Extremely good finding! Thanks. I'm not sure yet about the solution here, but I do not have a better idea either. So please give me some time to think about this in detail. -
Benni Mack voted on patch set 1 V +1 CR +1 03/02/21, 09:04
-
Oli Bartsch voted on patch set 1 V +1 CR +1 03/02/21, 09:17
-
Markus Klein commented on patch set 1 CR -1 03/09/21, 17:04
proposing a different solution -
Markus Klein uploaded patch set 2 03/09/21, 17:12
-
TYPO3com voted on patch set 2 V +1 03/09/21, 17:19 Completed build in 07m 01s on Tue, 9 Mar, 05:19 PM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9985
-
core-ci voted on patch set 2 V +1 03/09/21, 17:24 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1340
-
Markus Klein updated the commit message in patch set 3 03/10/21, 20:15
-
TYPO3com voted on patch set 3 V +1 03/10/21, 20:22 Completed build in 06m 25s on Wed, 10 Mar, 08:22 PM Test Summary: 32680 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10023
-
core-ci voted on patch set 3 V +1 03/10/21, 20:30 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1383
-
Oli Bartsch commented on patch set 3 03/10/21, 20:31
UserSession.php:88Would prefer `public function setLastUpdated(int $lastUpdated): void` Otherwise this is kind of a blackbox for the calling code and IMO also not really common behaviour for a setter "Give me some array and I'll look for suitable data myself". I would also appreciate a PHPDoc, to be consistent with the rest of the class. -
Markus Klein uploaded patch set 4 03/10/21, 20:51
-
TYPO3com voted on patch set 4 V -1 03/10/21, 20:52 Completed build in 19s on Wed, 10 Mar, 08:52 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10027
-
Markus Klein uploaded patch set 5 03/10/21, 20:53
-
Markus Klein commented on patch set 5 03/10/21, 20:55
UserSession.php:88ReplyI actually had it like this already, and then chose to change it to the current behaviour, because all other methods extract the data also. Moreover I can keep the actual session record field names (like ses_tstamp) rather "local" in this one class. Otherwise I need to call `setLastUpdated($record['ses_tstamp'])` hence exposing this "internal knowledge" in yet another class -
core-ci voted on patch set 4 V -1 03/10/21, 20:57 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1387
-
TYPO3com voted on patch set 5 V +1 03/10/21, 21:00 Completed build in 06m 56s on Wed, 10 Mar, 09:00 PM Test Summary: 32684 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10028
-
core-ci voted on patch set 5 V +1 03/10/21, 21:03 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1388
-
Oli Bartsch uploaded patch set 6 03/10/21, 21:15
-
Oli Bartsch commented on patch set 6 V +1 CR +1 03/10/21, 21:16
UserSession.php:88ReplyAck. Just added the PHPDoc. Thanks for the adjustments. -
Markus Klein commented on patch set 6 03/10/21, 21:17
Thanks @oliver -
TYPO3com voted on patch set 6 V +1 03/10/21, 21:22 Completed build in 07m 01s on Wed, 10 Mar, 09:22 PM Test Summary: 32684 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10030
-
core-ci voted on patch set 6 V +1 03/10/21, 21:27 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1391
-
Laurent Foulloy commented on patch set 6 V +1 CR +1 03/10/21, 22:02
Thanks for the patch -
Benni Mack commented on patch set 6 CR -1 03/11/21, 20:08
UserSessionManager.php:168UnresolvedWith this change, the $session (UserSession) entity will have an inconsistent state. I thought of this a few months ago. I suggest we either create a new session object (via a factory method) and return it here again (preferred option), or we create a „FixatedSession“ object (= new class) which works by composition of the UserSession (larger change) and we‘ll also add a UserSessionInterface which will be injected everywhere. -
Benni Mack uploaded patch set 7 03/11/21, 20:55
-
Benni Mack commented on patch set 7 03/11/21, 20:56
I hope my change is OK for everyone involved, would love to get some feedback if this PS is OK. -
TYPO3com voted on patch set 7 V -1 03/11/21, 21:03 Completed build in 07m 37s on Thu, 11 Mar, 09:03 PM Test Summary: 53 of 32920 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10055
-
Benni Mack commented on patch set 7 03/11/21, 21:06
Ah, now I see I'd need to adapt even more things :( sorry for the confusion. -
core-ci voted on patch set 7 V -1 03/11/21, 21:16 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1427
-
Laurent Foulloy voted on patch set 7 V -1 03/12/21, 12:36
-
Benni Mack uploaded patch set 8 04/06/21, 20:22
-
TYPO3com voted on patch set 8 V +1 04/06/21, 20:30 Completed build in 07m 52s on Tue, 6 Apr, 08:30 PM Test Summary: 33271 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10514
-
core-ci voted on patch set 8 V +1 04/06/21, 20:36 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2063
-
Xavier Perseguers commented on patch set 8 V -1 04/06/21, 20:52
FYI: conflicts with https://review.typo3.org/c/Packages/TYPO3.CMS/+/68716 -1 for the verification since it does not solve a regression I spotted: when you ask to reset your password, you enter your username/email and it sends you an email with a link and at the same time redirects you to the login form. It should show a flash message with the info that an email was sent but actually no flash message is shown, the session keeps somehow being invalidated when going back to the login form. The flash message is properly stored in DB though but in that case I think the session should not be anonymous anymore or ensured to be the one computed previously. -
Markus Klein commented on patch set 8 04/06/21, 21:01
UserSessionManager.php:253UnresolvedIt seems a bit overkill to read the session again from the backend, when it is already there actually
-
Benni Mack uploaded patch set 9 04/07/21, 15:11
-
TYPO3com voted on patch set 9 V +1 04/07/21, 15:18 Completed build in 07m 19s on Wed, 7 Apr, 03:18 PM Test Summary: 33271 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10523
-
core-ci voted on patch set 9 V +1 04/07/21, 15:22 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2075
-
Markus Klein commented on patch set 9 04/07/21, 20:59
AbstractUserAuthentication.php:1093we have to update this usage too, right? -
Laurent Foulloy voted on patch set 9 V +1 04/08/21, 09:11
-
Oliver Hader commented on patch set 9 V +1 04/23/21, 09:52
At least fixed #93974 -
Benni Mack uploaded patch set 10 04/30/21, 21:16
-
Benni Mack commented on patch set 10 04/30/21, 21:17
AbstractUserAuthentication.php:1093Replygood catch! thanks -
core-ci voted on patch set 10 V +1 04/30/21, 21:27 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10988
-
Markus Klein voted on patch set 10 CR +1 04/30/21, 21:36
-
Guido Schmechel voted on patch set 10 CR +1 05/01/21, 10:17
-
Benni Mack voted on patch set 10 V +1 CR +1 05/01/21, 11:43
-
Laurent Foulloy commented on patch set 10 V -1 05/01/21, 20:07
Sorry I forgot to clean the coockies of my browser when testing Patch 9. I get for Patch9 and 10 the error: Call to a member function isNew() on null when the method isSetSessionCookie() in FrontendUserAuthentication.php is called. -
Laurent Foulloy commented on patch set 10 05/02/21, 14:05
Reply
Sorry, Patch 10 was not applied correctly leading to the error. Patch is now correctly applied. Nevertheless it does not solve completely #93386. The following non-cachable default action is used for testing public function defaultAction() { $frontEndUser = $GLOBALS['TSFE']->fe_user; $value = $frontEndUser->getKey('ses', 'Test'); $value = $value + 1; $frontEndUser->setKey('ses', 'Test', $value); $frontEndUser->storeSessionData(); $this->view->assign('value', $value); } Data stored in the session are not recovered when the page is reloaded and the user is not authenticated. -
Oliver Hader commented on patch set 10 V -1 05/03/21, 14:05
I don't get exceptions anymore (good) - but I also don't get any frontend user cookie anymore. My test scenario (on same page) * ext:felogin plugin (invokes flash messages, has session interaction) * ext:form plugin (invokes honey pot field, has session interaction) -
Oliver Hader commented on patch set 10 CR -1 05/03/21, 15:00
I'm on it.. -
Oliver Hader uploaded patch set 11 05/03/21, 15:56
-
core-ci voted on patch set 11 V +1 05/03/21, 16:06 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11055
-
Oliver Hader commented on patch set 11 05/03/21, 16:16
Reply Unresolved
Salut, I've tested this scenario using a `USER_INT` via TypoScript and method `testCounter` containing the source code from above. With PS11 this seems to be working. ``` page { 20 = USER_INT 20.userFunc = Vendor\Example\ContentController->testCounter } ``` -
Oliver Hader voted on patch set 11 V +1 CR +1 05/03/21, 16:16
-
Markus Klein voted on patch set 11 CR +1 05/03/21, 17:04
-
Markus Klein voted on patch set 11 V +1 05/03/21, 18:02
-
Laurent Foulloy commented on patch set 11 V +1 05/03/21, 18:06
Thank you very much for this patch. -
Oliver Hader voted on patch set 11 V +2 CR +2 05/03/21, 19:06
-
Oliver Hader merged patch set 12 05/03/21, 19:07