yii\web\CacheSession::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)
    {
        $data = $this->cache->get($this->calculateKey($id));
        return $data === false ? '' : $data;
    }

Usage Example

예제 #1
0
 public function testCacheSession()
 {
     $session = new CacheSession();
     $session->writeSession('test', 'sessionData');
     $this->assertEquals('sessionData', $session->readSession('test'));
     $session->destroySession('test');
     $this->assertEquals('', $session->readSession('test'));
 }