public function authenticate(Adapter\AdapterInterface $adapter = null) { $result = parent::authenticate($adapter); if ($result->isValid()) { // Set authentication indicator cookie $lifetime = (int) $this->sessionConfig->getCookieLifetime(); $expires = $lifetime !== 0 ? time() + $lifetime : null; $lifetime = $lifetime !== 0 ? $lifetime : null; $this->setCookie(true, $expires, $lifetime); } return $result; }
public function testCookieLifetimeIsMutable() { $this->config->setCookieLifetime(20); $this->assertEquals(20, $this->config->getCookieLifetime()); }