DB\Mongo\Session::read PHP Method

read() public method

Return session data in serialized format
public read ( $id ) : string | FALSE
$id string
return string | FALSE
    function read($id)
    {
        $this->load(['session_id' => $this->sid = $id]);
        if ($this->dry()) {
            return FALSE;
        }
        if ($this->get('ip') != $this->_ip || $this->get('agent') != $this->_agent) {
            $fw = \Base::instance();
            if (!isset($this->onsuspect) || $fw->call($this->onsuspect, [$this, $id]) === FALSE) {
                //NB: `session_destroy` can't be called at that stage (`session_start` not completed)
                $this->destroy($id);
                $this->close();
                $fw->clear('COOKIE.' . session_name());
                $fw->error(403);
            }
        }
        return $this->get('data');
    }