O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

setrawcookie

Synopsis

void setrawcookie(string name[, string value[, int expiration[, string path
   [, string domain[, bool is_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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required