setcookie

void setcookie(string name, string value, [int expiration], 
              [string path], [string domain], [int secure]) 
name Cookie name
value Value of cookie
expiration Expiration time
path Server path
domain Domain name
secure Secure option

Sends an HTTP cookie to the client.

Returns:

Void

Description:

Sends an HTTP cookie to the client. Cookies are variables in key/value pairs sent by the server to the client, and are typically stored as text files. They also contain extra compulsory attributes as well as other optional attributes.

Cookies are a useful way to maintain information between browser sessions. The cookie is written to the client and retrieved by the server from the client on subsequent accesses to pages that match the specified ...

Get PHP Functions Essential Reference 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.