dear friends the cookie is not creating when page is loading ...when I refresh the page then it create cookies '
pzl heelp
thanks in advance

$count=0;
if(isset($_SESSION['counter'])){
$num=$_SESSION['counter'];
for($i=0;$i<$num+1;$i++){

if(!empty($_POST)){
//$arr=$_POST['p_name'.$i.''];
//$_SESSION['p_name']=array_unique($arr);
if(isset($_COOKIE['p_name'])||isset($_COOKIE['qty'])||isset($_COOKIE['prod_price'])){
//setcookie("p_name[".$count."]",$_POST['p_name'.$i.''],$expire);
}
//$_SESSION['p_name'][$i];

else {
//$array[$i]=$_POST['p_name'.$i.''];
setcookie("p_name[".$count."]",$_POST['p_name'.$i.''],$expire);
setcookie("qty[".$count."]",$_POST['product_qty'.$i.''],$expire);
setcookie("prod_price[".$count."]",$_POST['prod_price'.$i.''],$expire);
//setcookie("p_name[".$count."]",$_COOKIE['p_name'][$count],$expire);

} // end of else

echo "</tr>";
}// end if isset
$count++;
}// end of main for
}