yii\web\DbSession::readSession PHP Метод

readSession() публичный Метод

Do not call this method directly.
public readSession ( string $id ) : string
$id string session ID
Результат string the session data
    public function readSession($id)
    {
        $query = new Query();
        $query->from($this->sessionTable)->where('[[expire]]>:expire AND [[id]]=:id', [':expire' => time(), ':id' => $id]);
        if ($this->readCallback !== null) {
            $fields = $query->one($this->db);
            return $fields === false ? '' : $this->extractData($fields);
        }
        $data = $query->select(['data'])->scalar($this->db);
        return $data === false ? '' : $data;
    }

Usage Example

Пример #1
0
 /**
  * Session read handler.
  * Do not call this method directly.
  * @param string $id session ID
  * @return string the session data
  */
 public function readSession($id)
 {
     if ($this->dbSession) {
         return $this->dbSession->readSession($id);
     } else {
         parent::readSession($id);
     }
 }
All Usage Examples Of yii\web\DbSession::readSession