Previous Page
setContent()

Solar_Http_Response
setCookie()

Next Page
setCookiesHttponly()

setCookie()

public Solar_Http_Response setCookie ( string $name, string $value default '', int|string $expire default 0, string $path default '', string $domain default '', bool $secure default false, bool $httponly default NULL )

Sets a cookie value in $this->_cookies; will be sent to the client at display() time.

Parameters

  • (string) $name: The name of the cookie.
  • (string) $value: The value of the cookie.
  • (int|string) $expire: The Unix timestamp after which the cookie expires. If non-numeric, the method uses strtotime() on the value.
  • (string) $path: The path on the server in which the cookie will be available on.
  • (string) $domain: The domain that the cookie is available on.
  • (bool) $secure: Indicates that the cookie should only be transmitted over a secure HTTPS connection.
  • (bool) $httponly: When true, the cookie will be made accessible only through the HTTP protocol. This means that the cookie won't be accessible by scripting languages, such as JavaScript.

Returns

  • (Solar_Http_Response) This response object.

Description

Sets a cookie value in $this->_cookies; will be sent to the client at display() time.

See Also