readSession() public method

Do not call this method directly.
public readSession ( string $id ) : string
$id string session ID
return string the session data
Beispiel #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);
     }
 }
Beispiel #2
0
 /**
  * @depends testReadWrite
  */
 public function testGarbageCollection()
 {
     $session = new DbSession();
     $session->writeSession('new', 'new data');
     $session->writeSession('expire', 'expire data');
     $session->db->createCommand()->update('session', ['expire' => time() - 100], 'id = :id', ['id' => 'expire'])->execute();
     $session->gcSession(1);
     $this->assertEquals('', $session->readSession('expire'));
     $this->assertEquals('new data', $session->readSession('new'));
 }