Use setcookie to create a cookie.
setcookie ("TestCookie", "Test Value");
You should then be able to use the cookie variable with
echo $HTTP_COOKIE_VARS["TestCookie"];
However when you set a cookie the values held in it are not available until the page is reloaded.
Mark.