public function gc($expires = null) { if (!empty($this->cacheKey)) { Cache::gc($this->cacheKey); } return parent::gc($expires); }
/** * Method called on close of a database session. * * @return boolean Success * @access private */ public function close() { $probability = mt_rand(1, 150); if ($probability <= 3) { DatabaseSession::gc(); } return true; }
/** * test the garbage collector * * @return void */ public function testGc() { ClassRegistry::flush(); Configure::write('Session.timeout', 0); $storage = new DatabaseSession(); $storage->write('foo', 'Some value'); sleep(1); $storage->gc(); $this->assertSame($storage->read('foo'), ''); }
/** * @param null $expires * @return bool */ public function gc($expires = null) { return Cache::gc($this->cacheKey) && parent::gc($expires); }
public function save($object) { $this->databaseSession->executeNoResult(new SaveQuery($this->getTableName(), $object)); }