Is "Cookie is enabled." appearing in log.log?  If it is, try using $list in
the if statement at the bottom instead of $res->content.
--
Mac :})
----- Original Message -----
From: "rucan hebele" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 27, 2000 4:23 PM
Subject: again! Cookies


i have cookie problem. i am working on it last 5 days and i am tired.
i have read e-mail lists and documents. but i cant solve my problem.

first, look at this page: http://www.clickzones.com/cookiejs_test.php3
here is my script for testing:

#!/usr/bin/perl

use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Cookies;

$ua = new LWP::UserAgent;
$ua->agent('Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)');

#my $jar = HTTP::Cookies->new;
$jar = new HTTP::Cookies( ignore_discard => 1 );
$ua->cookie_jar($jar);

$headers1 = new HTTP::Headers
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*',
'Accept-Encoding' => 'gzip, deflate',
'Accept-Language' => 'en',
'Referer' =>
'http://www.clickzones.com/cookiejs_test.php3',
'Connection' => 'Keep-Alive',
'content_type' => 'application/x-www-form-urlencoded'
;

$headers = new HTTP::Headers
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*',
'Accept-Encoding' => 'gzip, deflate',
'Accept-Language' => 'en',
'Referer' => 'http://www.ucuzweb.com/kukupoke/',
'Connection' => 'Keep-Alive',
;

# Request for get cookies
$req = new HTTP::Request('GET',
'http://www.clickzones.com/cookiejs_test.php3', $headers);
my $res = $ua->request($req);

#Send cookies via POST - i am clicking button :-)
$req = new HTTP::Request('POST',
'http://www.clickzones.com/cookiejs_test.php3',
$headers1, 'output=Is+Javascript+supported%3F%3F%3F');
my $res=$ua->request($req);

$list=$res->content;

open(OUTF, ">log.log") or die("Log file cant open.");
print OUTF "$list";
close(OUTF);

if (($res->is_success) and ($res->content=~/is enabled/))
{print " ****** working ******\n";
}



i want this scripts output writes ****** working ****** .


Reply via email to