Bug #44202

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

Added by Helmut Hummel about 8 years ago. Updated almost 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

Also available in: Atom PDF