# # Temporarily pretends a cookie does not exist by modifying # the HTTP_COOKIE env variable. # sub rm_cookie { my ($cgi,$name) = @_; my $raw = $cgi->raw_cookie; # Obtain a list of all cookies (they are ; separated) # But exclude the one with the name you specify my @cookies = grep {!/^$name=/} split /; ?/, $raw; # Replace the HTTP_COOKIE env variable with the new fake # set of cookies. This is important, you might not want to # hide all cookies - just this one. $ENV{HTTP_COOKIE} = join('; ',@cookies); } #### rm_cookie($cgi, 'foo');