In PHP you do not need to specifically read cookies in your code and in fact there is no provision for you to do so. Since cookies are stored on your visitor's computer the only reason PHP can read them at all is that they are all passed to the server when the request to load a new web page that has access to those cookies is made. so once your PHP starts running all of the cookies that the page has access to have already been read and are available through the $_COOKIE global array. The same values may also be available through the $_REQUEST array which also contains the variables passed using the querystring or POSTed to the page however where any duplicate names exist between any of the three only one will be returned depending on how the server is configured for processing $_REQUEST. Since you should know which way you are expecting values to be passed you should read from the specific array rather than using $_REQUEST.
PHP wrotes cookies using the setcookie() function. This function can take up to seven parameters only the first of which is mandatory. The parameters this function can use are as follows.
The setcookie function returns true if the cookie has been ccreated successfully to send to the browser and false if it fails for any reason. Note that this does not test whether your visitor acctually accepts the cookie and the call can return true, send the cookie to the browser and then be discarded due to your visitor's settings with regard to session or first party cookies.
This article written by Stephen Chapman, Felgall Pty Ltd.