Bug #44202

$session->start() initializes a new session and does not resume a current one

Added by Helmut Hummel over 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Session
Start date:
2012-12-22
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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

Related to TYPO3.Flow - Feature #43376: Remote session managementResolvedRobert Lemke2012-12-01

Actions
Related to TYPO3.Flow - Bug #46428: Session is started on every requestResolvedBastian Waidelich2013-03-19

Actions
#1

Updated by Karsten Dambekalns over 8 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
#2

Updated by Karsten Dambekalns over 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… :)

#3

Updated by Robert Lemke about 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.

#4

Updated by Gerrit Code Review about 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

#5

Updated by Gerrit Code Review about 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

#6

Updated by Anonymous about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#7

Updated by Gerrit Code Review about 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

#8

Updated by Gerrit Code Review about 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

#9

Updated by Anonymous about 8 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF