Project

General

Profile

Actions

Bug #94187

closed

Session not updated within same page

Added by Aimeos no-lastname-given over 3 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2021-05-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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.

Actions #1

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!

Actions

Also available in: Atom PDF