Cookies are typically available on the second pass of the originating page. To help things along a bit, load header info to the page your calling and give it cookie_set=1
setcookie("testcookie", "Gingersnap", time()+8000);
header("Location:http://path_to_your_php_page.php?COOKIE_SET=1");
I got this grand information from:
http://perl.about.com/compute/perl/library/weekly/aa051600d.htm?terms=cookies.