All these cookie questions! I hope this solves some of them.
To set a cookie:
<?php
// cookies must be set before ANY information is sent to the browser
$cookievalue= "the value of the bloomin' cookie";
setcookie("MyCookie",$cookievalue,time()+1500,"/","WWW.domain.COM",0);
// NAME VALUE EXPIRETIME DOMAIN VALID FOR SECURE
?>
To view the value of the cookie:
<?php
echo "The cookie MyCookie has a value of ". $HTTP_COOKIE_VARS["MyCookie"] . "<BR>";
?>
Good luck,
Ben