Ejemplo n.º 1
0
 /**
  * Set a value in a public cookie with the given $name $value pairing.
  *
  * Public cookies can be accessed by JS. HttpOnly will be set to false by default for these cookies,
  * but can be changed to true.
  *
  * @param string $name
  * @param string $value
  * @param PublicCookieMetadata $metadata
  * @return void
  * @throws FailureToSendException If cookie couldn't be sent to the browser.
  * @throws CookieSizeLimitReachedException Thrown when the cookie is too big to store any additional data.
  * @throws InputException If the cookie name is empty or contains invalid characters.
  */
 public function setPublicCookie($name, $value, PublicCookieMetadata $metadata = null)
 {
     $metadataArray = $this->scope->getPublicCookieMetadata($metadata)->__toArray();
     $this->setCookie($name, $value, $metadataArray);
 }