function createSession(array $cookieData, $userProfile = null)
    {
        if (!array_key_exists($this->sessionConfig->getSessionName(), $cookieData)) {
            return $this->driver->createSession($this, $userProfile);
        }

        $sessionID = $cookieData[$this->sessionConfig->getSessionName()];
        $existingSession = $this->openSessionByID($sessionID, $userProfile);

        if ($existingSession !== null) {
            return $existingSession;
        }
        
        $this->invalidSessionAccessed();
        return $this->driver->createSession($this, $userProfile);
    }
function createSession(array $cookieData, $userProfile = null)
    {
        if (!array_key_exists($this->sessionConfig->getSessionName(), $cookieData)) {
            return $this->driver->createSession($this, $userProfile);
        }

        $sessionID = $cookieData[$this->sessionConfig->getSessionName()];
        $existingSession = $this->openSessionByID($sessionID, $userProfile);

        if ($existingSession !== null) {
            return $existingSession;
        }
        
        $this->invalidSessionAccessed();
        return $this->driver->createSession($this, $userProfile);
    }
function createSession ( array $ cookieData , $ userProfile = null ) { if ( ! array_key_exists ( $ this -> sessionConfig -> getSessionName ( ) , $ cookieData ) ) { return $ this -> driver -> createSession ( $ this , $ userProfile ) ; } $ sessionID = $ cookieData [ $ this -> sessionConfig -> getSessionName ( ) ] ; $ existingSession = $ this -> openSessionByID ( $ sessionID , $ userProfile ) ; if ( $ existingSession !== null ) { return $ existingSession ; } $ this -> invalidSessionAccessed ( ) ; return $ this -> driver -> createSession ( $ this , $ userProfile ) ; }
Create a new session or open existing session.

Opens and returns the data for an existing session, if and only if the
client sent a valid existing session ID. Otherwise creates a new session.

@param array $cookieData
@param $userProfile
@return Session
Create a new session or open existing session .