Neos\Flow\Session\Session::renewId PHP Method

renewId() public method

Generates and propagates a new session ID and transfers all existing data to the new session.
public renewId ( ) : string
return string The new session ID
    public function renewId()
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('Tried to renew the session identifier, but the session has not been started yet.', 1351182429);
        }
        if ($this->remote === true) {
            throw new Exception\OperationNotSupportedException(sprintf('Tried to renew the session identifier on a remote session (%s).', $this->sessionIdentifier), 1354034230);
        }
        $this->removeSessionMetaDataCacheEntry($this->sessionIdentifier);
        $this->sessionIdentifier = Algorithms::generateRandomString(32);
        $this->writeSessionMetaDataCacheEntry();
        $this->sessionCookie->setValue($this->sessionIdentifier);
        return $this->sessionIdentifier;
    }