yii\web\CacheSession::destroySession PHP 메소드

destroySession() 공개 메소드

Do not call this method directly.
public destroySession ( string $id ) : boolean
$id string session ID
리턴 boolean whether session is destroyed successfully
    public function destroySession($id)
    {
        return $this->cache->delete($this->calculateKey($id));
    }

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'));
 }