Name
setcookie
Synopsis
void setcookie(stringname
[, stringvalue
[, intexpiration
[, stringpath
[, stringdomain
[, boolis_secure
]]]]])
Generates a cookie and passes it along with the rest of the header
information. Because cookies are set in the HTTP header,
setcookie( )
must be called before any output is
generated.
If only name
is specified, the cookie with
that name is deleted from the client. The
value
argument specifies a value for the
cookie to take, expiration
is a Unix
timestamp value defining a time the cookie should expire, and the
path
and domain
parameters define a domain for the cookie to be associated with. If
is_secure
is true
, the
cookie will be transmitted only over a secure HTTP connection.
Get Programming PHP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.