use HTML::Cookie; $ua->redirect_ok(1); $ua->cookie_jar(HTTP::Cookies->new(file => '/tmp/cookies.txt', autosave => 1 ));