#!/usr/bin/perl -w use strict; use LWP; use HTTP::Cookies; use Data::Dumper; my $oper = shift; my $user = 'user'; my $pword = 'pasword'; my $cj = HTTP::Cookies->new; my $ua = LWP::UserAgent->new; $ua->cookie_jar( $cj ); # A place to hold the cookies from ETSS BO's $ua->agent("PerlWebBot/1.0 "); # Create a request my $req = HTTP::Request->new(POST => 'http://xmes.mydomain.com/pack/usermgr'); $req->content_type('application/x-www-form-urlencoded'); $req->content("operation=authenticateUser&userid=$user"."&password=$pword"); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print "Got something back...\n"; } else { print "Unable to contact server \n"; } print "LWP Version -> " , $LWP::VERSION , "\n"; print "Cookie Cutter -> " , $HTTP::Cookies::VERSION , "\n"; print $res->headers()->as_string() , "\n\n"; print Dumper($ua->cookie_jar() ) ; ----------------------------------------------------- results: D:\code>wipit.pl Got something back... LWP Version ->5.69 Cookie cutter -> 1.30 Connection: close Date: Fri, 27 Jun 2003 01:49:30 GMT Server: Apache/1.3.14 (Unix) tomcat/1.0 Content-Type: text/plain Client-Date: Fri, 27 Jun 2003 05:49:36 GMT Client-Peer: 9.61.8.22:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Set-Cookie: member=QkFERVJEICB8KioqKioqKip8MTA1NjY3ODU3MXxXRVNUfDE0MzI2fEVTVDVFRFR8VVN8ZW58OS42Ni4xNzQuMjAzfDc 0MTAzOHw=; expires=Fri, 27-Jun-2003 02:09:31 GMT; path=/; domain=btv.ibm.com; $VAR1 = bless( { 'COOKIES' => { '.btv.ibm.com' => { '/' => {} } } }, 'HTTP::Cookies' ); Linux:----------- Got something back... LWP Version ->5.69 Cookie cutter -> 1.30 Connection: close Date: Fri, 27 Jun 2003 01:29:41 GMT Server: Apache/1.3.14 (Unix) tomcat/1.0 Content-Type: text/plain Client-Date: Fri, 27 Jun 2003 01:29:28 GMT Client-Peer: 9.61.8.22:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Set-Cookie: member=QkFERVJEICB8KioqKioqKip8MTA1NjY3NzM4MnxXRVNUfDE0ODI4fEVTVDVFRFR8VVN8ZW58OS42Ni4xNzUuMTk3fDc 0MTAzOHw=; expires=Fri, 27-Jun-2003 01:49:42 GMT; path=/; domain=btv.ibm.com; $VAR1 = bless( { 'COOKIES' => { '.btv.ibm.com' => { '/' => { 'member' => [ 0, 'QkFERVJEICB8KioqKioqKip8MTA1NjY3Nz M4MnxXRVNUfDE0ODI4fEVTVDVFRFR8VVN8ZW58OS42Ni4xNzUuMTk3fDc0MTAzOHw=', undef, '1', undef, '1056678582' ] } } } }, 'HTTP::Cookies' ); Window Perl 5.6.1 ---------------------- Got something back... LWP Version ->5.51 Cookie cutter -> 1.14 Connection: close Date: Fri, 27 Jun 2003 01:36:56 GMT Server: Apache/1.3.14 (Unix) tomcat/1.0 Content-Type: text/plain Client-Date: Fri, 27 Jun 2003 01:43:09 GMT Client-Peer: 9.61.8.22:80 Set-Cookie: member=QkFERVJEICB8KioqKioqKip8MTA1NjY3NzgxN3xXRVNUfDMyMjI3fEVTVDVFRFR8VVN8ZW58OS42Ni4xNzUuMTR8NzQ xMDM4fA==; expires=Fri, 27-Jun-2003 01:56:57 GMT; path=/; domain=btv.ibm.com; $VAR1 = bless( { 'COOKIES' => { '.btv.ibm.com' => { '/' => { 'member' => [ 0, 'QkFERVJEICB8KioqKioqKip8MTA1NjY3NzgxN3xXRVNU fDMyMjI3fEVTVDVFRFR8VVN8ZW58OS42Ni4xNzUuMTR8NzQxMDM4fA==', undef, '1', undef, '1056679017' ] } } } }, 'HTTP::Cookies' );