Cookike problem

I’m faced with the cookie problem.
we’re using setcookie() on the domain www.example.com
but in fact I need to setup cookies for example.com domain.
so, I use the following syntax (due to php manual):
setcookie(‘surferid’, 10, 0, ‘/’, ‘.example.com’);
This way we hope to set cookies for all example.com subdomains.
But anyway I can’t read cookie.

setcookie(‘surferid’, ‘10’, time()+0,’/’,‘host.com’);

than u will need a refresh of page inorder to be able to do this


echo $_COOKIE['surferid'];

and make sure that cookie is being set in the header of the document!