how to set and destroy cookie in same page without affecting the serching data?
<p>I am trying to search data and display data in same page with help of cookies.it is work fine but when i try to destroy cookies,the result data is loss and no searching happen.i also use pagination.when i click on another page no. in pagination,same the result data is lost.this is only happen when i destroy the cookies. and if i not destroy the cookies the data is continue display even i press enter in url.<br>                                                                                        <code>php code</code>: </p>

<pre><code>   $depart_type=''; 
   if(isset($_COOKIE['depart_type']))
      {
        $depart_type = $_COOKIE['depart_type'];
      }   
    if($_POST['department_type']!='')
      {
        $depart_type = $_POST['department_type'];
        setcookie("depart_type",$depart_type,time()+3600,"/"); 
     }       
     $whr ="1";
    if($depart_type!="")
    {
        $whr .= "  AND `department_type` = '$depart_type'";
     } 
       $QryStaff = mysql_query("select * from `tbl_staff` where $whr) or die(mysql_error());    
</code></pre>

<p>so, problem is when and where i destroy or unset cookies?                                                                             </p>
