isHttpOnly() публичный Метод

Checks whether the cookie will be made accessible only through the HTTP protocol.
public isHttpOnly ( ) : boolean
Результат boolean
 /**
  * Set the given cookie in the headers.
  *
  * @param  \Symfony\Component\HttpFoundation\Cookie  $cookie
  * @return void
  */
 protected function setCookie($cookie)
 {
     if (headers_sent()) {
         return;
     }
     setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), Config::get('session.secure'), $cookie->isHttpOnly());
 }
Пример #2
0
 public function testIsHttpOnly()
 {
     $cookie = new Cookie('foo', 'bar', 3600, '/', '.myfoodomain.com', false, true);
     $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns whether the cookie is only transmitted over HTTP');
 }
 /**
  * Duplicate a cookie with a new value.
  *
  * @param  \Symfony\Component\HttpFoundation\Cookie  $c
  * @param  mixed  $value
  * @return \Symfony\Component\HttpFoundation\Cookie
  */
 protected function duplicate(Cookie $c, $value)
 {
     return new Cookie($c->getName(), $value, $c->getExpiresTime(), $c->getPath(), $c->getDomain(), $c->isSecure(), $c->isHttpOnly());
 }
Пример #4
0
 /**
  * Create a new cookie from the current (template) cookie with a new value.
  *
  * @param $value
  * @return Cookie
  */
 private function createCookieWithValue($value)
 {
     return new Cookie($this->cookieSettings->getName(), $value, $this->cookieSettings->getExpiresTime(), $this->cookieSettings->getPath(), $this->cookieSettings->getDomain(), $this->cookieSettings->isSecure(), $this->cookieSettings->isHttpOnly());
 }
Пример #5
0
 /**
  * Duplicate a cookie with a new name.
  *
  * @param  \Symfony\Component\HttpFoundation\Cookie  $cookie
  * @param  mixed  $name
  * @return \Symfony\Component\HttpFoundation\Cookie
  */
 private function rename(Cookie $c, $name)
 {
     return new Cookie($name, $c->getValue(), $c->getExpiresTime(), $c->getPath(), $c->getDomain(), $c->isSecure(), $c->isHttpOnly());
 }