Bug #44202
$session->start() initializes a new session and does not resume a current one
100%
Description
Disclaimer: I did not test anything, but only making assumptions by reading the code. Just close this ticket if I'm mistaken.
When introducing the new session handling in #43376 the "start" method of the session object changed it's notion.
Before "start" initialized a new session or resumed an existing one
public function start() { if ($this->started === FALSE) { $this->startOrResume(); } }
Now the start method clearly initializes a completely new session:
public function start() { if ($this->request === NULL) { $this->initializeHttpAndCookie(); } if ($this->started === FALSE) { $this->sessionIdentifier = Algorithms::generateRandomString(32); $this->storageIdentifier = Algorithms::generateUUID(); ...
This is a severe change in behaviour, which at least breaks the @Flow\Session(autoStart=true) annotation, because the LazyLoadingAspect explicitly calls $this->session->start();
public function initializeSession(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) { if ($this->session->isStarted() === TRUE) { return; } $objectName = $this->objectManager->getObjectNameByClassName(get_class($joinPoint->getProxy())); $methodName = $joinPoint->getMethodName(); $this->systemLogger->log(sprintf('Session initialization triggered by %s->%s.', $objectName, $methodName), LOG_DEBUG); $this->session->start(); }
These methods will never get a resumed session, but always a fresh one.
P.S.: I cannot select the "Session" category, but only Documentation, Testing and Build Process. Maybe you should check the project permissions.
Related issues