Hi Gisle and all,

I'd like to add a clear_session() method to HTTP::Cookies simulating
closing the browser by clearing all session cookies. Code is below ...

=item $cookie_jar->clear_session( );

Simulate closing the browser by clearing all session cookies
(which don't have an expire field set).

=cut

sub clear_session
{
    my($self) = @_;

    $self->scan(sub {
        if(not $_[8]) {    # No expire field?
            $_[8] = -1;            # Set the expire/max_age field
            $self->set_cookie(@_); # Clear the cookie
        }
      });
}

__END__

-- Mike
--------------------------------------------------------
Mike Schilli [EMAIL PROTECTED] http://perlmeister.com
--------------------------------------------------------

Reply via email to