Пример #1
0
 protected function generateCookie()
 {
     $lifetime = $this->options->getInt('cookie_lifetime');
     if ($lifetime !== 0) {
         $lifetime += time();
     }
     return new Cookie($this->session->getName(), $this->session->getId(), $lifetime, $this->options['cookie_path'], $this->options['cookie_domain'] ?: null, $this->options->getBoolean('cookie_secure'), $this->options->getBoolean('cookie_httponly'));
 }
Пример #2
0
 protected function write()
 {
     $data = $this->serializer->serialize($this->data);
     if ($this->options->getBoolean('lazy_write', false) && $this->handler instanceof LazyWriteHandlerInterface && md5($data) === $this->dataHash) {
         $this->handler->updateTimestamp($this->id, $data);
     } else {
         $this->handler->write($this->id, $data);
     }
 }