public function read($id)
    {
        $key = $this->getSessionKey($id);
        return $this->getDataFromCache($key)->then(
            function($record) {
                return $this->extractData($record, true);
            }
        )->then(
            null,
            function($error = null) use ($id) {
                //return $self->restoreSessionData($id, true)->then(
                return $this->archive->get($id)->then(
                    function($data) use ($id, $error) {
                        if (is_array($data)) {
                            return $this->write($id, $data);
                        } else {
                            return \Reaction\Promise\reject($error);
                        }
                    }
                );
            }
        )->then(
            null,
            function($error = null) use ($id) {
                $message = sprintf('Failed to read session data for "%s"', $id);
                throw new SessionException($message, 0, $error);
            }
        );
    }
public function read($id)
    {
        $key = $this->getSessionKey($id);
        return $this->getDataFromCache($key)->then(
            function($record) {
                return $this->extractData($record, true);
            }
        )->then(
            null,
            function($error = null) use ($id) {
                //return $self->restoreSessionData($id, true)->then(
                return $this->archive->get($id)->then(
                    function($data) use ($id, $error) {
                        if (is_array($data)) {
                            return $this->write($id, $data);
                        } else {
                            return \Reaction\Promise\reject($error);
                        }
                    }
                );
            }
        )->then(
            null,
            function($error = null) use ($id) {
                $message = sprintf('Failed to read session data for "%s"', $id);
                throw new SessionException($message, 0, $error);
            }
        );
    }
public function read ( $ id ) { $ key = $ this -> getSessionKey ( $ id ) ; return $ this -> getDataFromCache ( $ key ) -> then ( function ( $ record ) { return $ this -> extractData ( $ record , true ) ; } ) -> then ( null , function ( $ error = null ) use ( $ id ) { //return $self->restoreSessionData($id, true)->then( return $ this -> archive -> get ( $ id ) -> then ( function ( $ data ) use ( $ id , $ error ) { if ( is_array ( $ data ) ) { return $ this -> write ( $ id , $ data ) ; } else { return \ Reaction \ Promise \ reject ( $ error ) ; } } ) ; } ) -> then ( null , function ( $ error = null ) use ( $ id ) { $ message = sprintf ( 'Failed to read session data for "%s"' , $ id ) ; throw new SessionException ( $ message , 0 , $ error ) ; } ) ; }
Read session data and returns serialized|encoded data
@param string $id
@return ExtendedPromiseInterface  with session data
Read session data and returns serialized|encoded data