src/DynamoDb/SessionHandler.php
public function read($id)
    {
        $this->openSessionId = $id;
        // PHP expects an empty string to be returned from this method if no
        // data is retrieved
        $this->dataRead = '';

        // Get session data using the selected locking strategy
        $item = $this->connection->read($this->formatId($id));

        // Return the data if it is not expired. If it is expired, remove it
        if (isset($item['expires']) && isset($item['data'])) {
            $this->dataRead = $item['data'];
            if ($item['expires'] <= time()) {
                $this->dataRead = '';
                $this->destroy($id);
            }
        }

        return $this->dataRead;
    }
public function read($id)
    {
        $this->openSessionId = $id;
        // PHP expects an empty string to be returned from this method if no
        // data is retrieved
        $this->dataRead = '';

        // Get session data using the selected locking strategy
        $item = $this->connection->read($this->formatId($id));

        // Return the data if it is not expired. If it is expired, remove it
        if (isset($item['expires']) && isset($item['data'])) {
            $this->dataRead = $item['data'];
            if ($item['expires'] <= time()) {
                $this->dataRead = '';
                $this->destroy($id);
            }
        }

        return $this->dataRead;
    }
public function read ( $ id ) { $ this -> openSessionId = $ id ; // PHP expects an empty string to be returned from this method if no // data is retrieved $ this -> dataRead = '' ; // Get session data using the selected locking strategy $ item = $ this -> connection -> read ( $ this -> formatId ( $ id ) ) ; // Return the data if it is not expired. If it is expired, remove it if ( isset ( $ item [ 'expires' ] ) && isset ( $ item [ 'data' ] ) ) { $ this -> dataRead = $ item [ 'data' ] ; if ( $ item [ 'expires' ] <= time ( ) ) { $ this -> dataRead = '' ; $ this -> destroy ( $ id ) ; } } return $ this -> dataRead ; }
Read a session stored in DynamoDB.

@param string $id Session ID.

@return string Session data.
Read a session stored in DynamoDB .