smith
smith

Reputation: 3262

Mojo::UserAgent clear session data

I have some code which using Mojo::UserAgent

after the second request i see some cookies on the header which come from the first request , how is it possible to remove those cookies from the second request using the same agent

without writing for every request

my $ua = Mojo::UserAgent->new

Upvotes: 1

Views: 183

Answers (1)

Patrick Mevzek
Patrick Mevzek

Reputation: 12515

That should do it:

$ua->cookie_jar()->empty();

The whole purpose of cookies is to have a state between each request. If you need to empty them, I think you may have a completely different problem.

Upvotes: 4

Related Questions