update cookie value in php
I am converting the array into cookie by php serialize function $PromoteuserId='1'; $PromoteProductId='2'; $PromoteBrandId='3'; $PromoteProductArray = array("PromoteuserId"=>$PromoteuserId, "PromoteProductId"=>$PromoteProductId, "PromoteBrandId"=>$PromoteBrandId ); $Promotedcart[] = $PromoteProductArray; setcookie("Promotedcart", urlencode(serialize($Promotedcart)), time()+604800,'/'); And when the cookie is created then i am using the unserialize php function. print_r(unserialize(urldecode($_COOKIE['Promotedcart']))); I need to update the cookie value. E.g. - I need to search for