protected function loadSession(Connection $connection)
    {
        $sessionId = $connection->session = $this->getSessionIdFromCookie($connection);
        
        $session = clone $this->Session;
        $session->setId($sessionId);
        $session->start();
        
        $readonly = (new ReadOnly(config('session.cookie')))->initialize($session->all(), $sessionId);
        WsSession::swap($readonly);
        Session::flush();
        
        unset($session);
    }
protected function loadSession(Connection $connection)
    {
        $sessionId = $connection->session = $this->getSessionIdFromCookie($connection);
        
        $session = clone $this->Session;
        $session->setId($sessionId);
        $session->start();
        
        $readonly = (new ReadOnly(config('session.cookie')))->initialize($session->all(), $sessionId);
        WsSession::swap($readonly);
        Session::flush();
        
        unset($session);
    }
protected function loadSession ( Connection $ connection ) { $ sessionId = $ connection -> session = $ this -> getSessionIdFromCookie ( $ connection ) ; $ session = clone $ this -> Session ; $ session -> setId ( $ sessionId ) ; $ session -> start ( ) ; $ readonly = ( new ReadOnly ( config ( 'session.cookie' ) ) ) -> initialize ( $ session -> all ( ) , $ sessionId ) ; WsSession :: swap ( $ readonly ) ; Session :: flush ( ) ; unset ( $ session ) ; }
Load the Session data and store it into a Read-Only Session.

@param \Ratchet\ConnectionInterface $connection
@return void
Load the Session data and store it into a Read - Only Session .