ManaPHP\Http\Session\Adapter\Db::read PHP Method

read() public method

public read ( string $sessionId ) : string
$sessionId string
return string
    public function read($sessionId)
    {
        /**
         * @var \ManaPHP\Http\Session\Adapter\Db\Model $model ;
         */
        $model = new $this->_model();
        $model = $model::findFirst(['session_id' => $sessionId]);
        if ($model !== false && $model->expired_time > time()) {
            return $model->data;
        } else {
            return '';
        }
    }