Function

setcookie

Synopsis

setcookie(string, mixed ...): bool

Area
Runtime\PS\HTTP\SAPI\setcookieareas

Description

setcookie stages a Set-Cookie header naming $name with $value url-encoded, and answers whether it could; $expires_or_options is a unix timestamp, 0 for a cookie that dies with the browser session, or an array of expires, path, domain, secure, httponly and samesite.

Usage

$value = setcookie($arguments);
$fn = setcookie(...);

See also