You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Issam W. Alameh" <is...@alameh.net> on 2000/08/05 17:31:27 UTC

fake browser

Hello,
I don't know where to go with this question, may be somebody can help here,

I have written a small program to simulate login to a site, but the site is
trying to find out if the browser accessing it accepts cookies or not, and I
wanted to know how to fake this, i.e. how to tell the program that I am a
browser who is accepting cookies,

I am using LWP::UserAgent to do the simulation, and I already told the site
I am logging to that I am mozilla/4.0,

here is a snippet of the code

require LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent('Mozilla/4.0');
$request = new HTTP::Request GET=>
'http://www.namesforall.com/mail/login.cgi?user=me&password=mine';
$response = $ua->request($request);

Issam