ice framework documentation ice doc v1.6.2
Class Ice

Cookies

Methods
  • getSalt() : void
  • setSalt(variable $salt) : void
  • getExpiration() : void
  • setExpiration(variable $expiration) : void
  • getPath() : void
  • setPath(variable $path) : void
  • getDomain() : void
  • setDomain(variable $domain) : void
  • getSecure() : void
  • setSecure(variable $secure) : void
  • getHttpOnly() : void
  • setHttpOnly(variable $httpOnly) : void
  • getEncrypt() : void
  • setEncrypt(variable $encrypt) : void
  • __construct(string $salt) : void
  • has(string $key) : bool
    Does cookie contain a key
  • get(string $key, variable $defaultValue) : void
    Gets the value of a signed cookie.
  • set(string $key, string $value, int $lifetime) : void
    Sets a signed cookie.
  • remove(string $key) : bool
    Deletes a cookie by making the value NULL and expiring it.
  • salt(variable $name, variable $value) : string
    Generates a salt string for a cookie based on the name and value.
  • setcookie(string $name, string $value, int $expire, string $path, string $domain, bool $secure, bool $httpOnly) : void
    Proxy for the native setcookie function - to allow mocking in unit tests so that they do not fail when headers
Methods Details
  • public function getSalt()

  • public function setSalt(variable $salt)

  • public function getExpiration()

  • public function setExpiration(variable $expiration)

  • public function getPath()

  • public function setPath(variable $path)

  • public function getDomain()

  • public function setDomain(variable $domain)

  • public function getSecure()

  • public function setSecure(variable $secure)

  • public function getHttpOnly()

  • public function setHttpOnly(variable $httpOnly)

  • public function getEncrypt()

  • public function setEncrypt(variable $encrypt)

  • public function __construct(string $salt)

  • public function has(string $key)

    Does cookie contain a key
  • public function get(string $key, variable $defaultValue)

    Gets the value of a signed cookie.
    Cookies without signatures will not be returned. If the cookie signature is present, but invalid, the cookie will be deleted.
  • public function set(string $key, string $value, int $lifetime)

    Sets a signed cookie.
    Note that all cookie values must be strings and no automatic serialization will be performed!
  • public function remove(string $key)

    Deletes a cookie by making the value NULL and expiring it.
  • public function salt(variable $name, variable $value)

    Generates a salt string for a cookie based on the name and value.
  • protected function setcookie(string $name, string $value, int $expire, string $path, string $domain, bool $secure, bool $httpOnly)

    Proxy for the native setcookie function - to allow mocking in unit tests so that they do not fail when headers
    have been sent.