I'm using WWW::Mechanize
Here is a snippet of code:
$mech->get($url);
$mech->form_name('loginform');
$mech->set_fields(user_login => $username, user_pass => $password);
$mech->click();
my $output_page = $mech->content();
if ($output_page =~ m/cookies/) {
$TestStatus = 1;
ok( $TestStatus , "Login failed - Browser not enabled to accept co
+okies error");
# Try logging in again - should work this time...
$mech->get($url);
$mech->form_name('loginform');
$mech->set_fields(user_login => $username, user_pass => $password);
$mech->click();
}
The first attempt fails and I get the cookies error, which tells me that I'm populating the user_login and user_pass fields. But after invoking the click method, I can't seem to repopulate the fields - at least that's how the site is behaving...