Yep, because you aren't actually outputting anything to the browser...
Example:
<?php
if(isset($_COOKIE['testing'])) {
echo $_COOKIE['testing'];
} else {
$test = "test";
setcookie("testing",@$test,time()+365*1440*60);
header("Location: test.php");
}
?>
Basically, if the cookie is set, we echo the value of the cookie. If it isn't, then we set it, and redirect back to the page (which again verifies its existence.)
You may want to build in an exit mechanism so you don't get caught in an endless loop if someone has their browser set to block cookies, but this should give you an idea of how/where to begin.