PX : code

function to remove cookies set as array by Robert Zwink
Download this code


<?php

    
// This is pretty simple.  There are no arguments. 
    //  Once this function is finished the string $final  
    //  will echo the cookies that have been deleted

    
    
function clear_cookies(){
        global 
$HTTP_COOKIE_VARS;
        
$cookie_count count($HTTP_COOKIE_VARS);
        for(
$i 0$i<$cookie_count$i++){
            
$current_cookie current($HTTP_COOKIE_VARS);
            
$cookie_name key($HTTP_COOKIE_VARS);

            
$current_cookie_count count($current_cookie);
            for(
$c 0$c $current_cookie_count$c++){        
                
$val current($current_cookie);
                
$cookie_to_delete $cookie_name."[".$val."]";
                
setcookie($cookie_to_delete);
                
$final .= "Deleting . . . $cookie_to_delete<BR>\n";
                
next($current_cookie);
                }
            
next($HTTP_COOKIE_VARS);
            }
        }
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.