[MySQL/PHP] cookies not working

This is part of my code for a log in page. The setcookie function is not making any cookies though. How do I know? I tried echoing it and nothing was printed to the screen. I have already made sure that $ID is being set properly.


echo("<h2>Log In</h2>");
if($num != 0)
{
	// message
	echo("Log in is successful.");
	
	// log in
	if($rememberMe == "checked")
	{
		$expTime = 2592000;
	}
	else 
	{
		$expTime = 864000;
	}
	$row = mysql_fetch_array($rs);
	$ID = $row["ID"];
	setcookie("ID", $ID, time()+$expTime);
}