Bug #94187
closedSession not updated within same page
0%
Description
Precondition: Two frontend plugins are placed on the same page
1.) In the user session, "key" has been set to "test" in a different request before
2.) Plugin 1 updates a key in the user session using \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::setAndSaveSessionData('key', 'test2')
3.) Plugin 2 on the same page reads the key using \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getSessionData('key')
The value returned in plugin 2 is "test", not "test2".
In TYPO3 9.5, the correct value ("test2) has been returned.
Updated by Georg Ringer 4 months ago
- Status changed from New to Closed
Hey Norbert,
just tested that in v13 with simple example
$contentObjectData = $this->request->getAttribute('currentContentObject'); $el = $contentObjectData->data; $uid = $el['uid']; $user = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.user'); $newCache = 'dataValue' . time(); if ($uid === 5) { $user->setAndSaveSessionData('dataKey', $newCache); } DebuggerUtility::var_dump($user->getSessionData('dataKey'), 'el' . $uid);
and it worked out fine. Important is that the 2nd plugin is really rendered after the 1st one, so e.g. because it is positioned in same colpos but after the 1st one.
if you don't agree, feel free to contact me via slack!