Name
setrawcookie
Synopsis
void setrawcookie(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—unlike setcookie()
,
the value specified here is not URL encoded before being sent,
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, 3rd Edition 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.