I tried to access the authenticated page config.cgi using the below code. But I am not able to access them with the authenticated session. I get only the login page at the second request. Somebody please tell me whats wrong in this script.
my $ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
$url = 'http://localhost/web_authenticate_post.cgi';
$req = HTTP::Request->new(POST => $url);
$req->content_type('application/x-www-form-urlencoded');
$req->content('username=security&password=security&login=Login');
my $res=$ua->request($req);
if($res->is_success){
$res1 = $ua->request(HTTP::Request->new(GET=>'http://localhost/conf
+ig.cgi'
));
print $res1->content;
}
else{
print $res->status_line;
}