Constructor.
public __construct ( string $name, string | null $value = null, integer | string | DateTimeInterface $expire, string $path = '/', string | null $domain = null, boolean $secure = false, boolean $httpOnly = true, boolean $raw = false, string | null $sameSite = null ) | ||
$name | string | The name of the cookie |
$value | string | null | The value of the cookie |
$expire | integer | string | DateTimeInterface | The time the cookie expires |
$path | string | The path on the server in which the cookie will be available on |
$domain | string | null | The domain that the cookie is available to |
$secure | boolean | Whether the cookie should only be transmitted over a secure HTTPS connection from the client |
$httpOnly | boolean | Whether the cookie will be made accessible only through the HTTP protocol |
$raw | boolean | Whether the cookie value should be sent with no url encoding |
$sameSite | string | null | Whether the cookie will be available for cross-site requests |