/** * {@inheritdoc} */ public function save() { $this->handler->write($this->id, serialize($this->data)); // this is needed for Silex, where the session object is re-used across requests // in functional tests. In Symfony, the container is rebooted, so we don't have // this issue $this->started = false; }
public function testGc() { $prefix = $this->path . '/mocksess_'; $this->handler->write('1', 'data'); touch($prefix . '1', time() - 86400); $this->handler->write('2', 'data'); touch($prefix . '2', time() - 3600); $this->handler->write('3', 'data'); touch($prefix . '3', time() - 300); $this->handler->write('4', 'data'); $this->handler->gc(90000); $this->assertEquals(4, count(glob($this->path . '/*'))); $this->handler->gc(4000); $this->assertEquals(3, count(glob($this->path . '/*'))); $this->handler->gc(200); $this->assertEquals(1, count(glob($this->path . '/*'))); }
/** * {@inheritdoc} */ public function save() { $this->handler->write($this->id, serialize($this->data)); }