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
Updated by Karsten Dambekalns about 8 years ago
- Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
Updated by Karsten Dambekalns about 8 years ago
- Category set to Session
- Status changed from New to Needs Feedback
- Assignee set to Robert Lemke
- Has patch set to No
Helmut, the categories you were looking for are in the Flow project, not the base distribution… :)
Updated by Robert Lemke almost 8 years ago
The session is automatically resumed by the Bootstrap (calling resume()) and if that was successful, calling start() at a later stage will be a noop. I'll add a description of that mechanism to the Script doc comment.
Updated by Gerrit Code Review almost 8 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19338
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19338
Updated by Anonymous almost 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2fdafb69fa403e2bc55c10f9f1d28808dcd0fc6f.
Updated by Gerrit Code Review almost 8 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19594
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19594
Updated by Anonymous almost 8 years ago
- Status changed from Under Review to Resolved
Applied in changeset 8f6917b64af670e3b0bd4d288b94fde74971ae6c.