Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My debuging shows that the cookies are not being set. What am I doing wrong? Plese help.use warnings; use strict; use LWP::UserAgent; use HTTP::Request; use HTTP::Response; use HTTP::Cookies; use URI::URL; $|++; my $url = url( 'http://www.somedomain.com/cgi-bin/message.cgi' ); my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new( GET => $url ); $request->referer('http://who.wantsta.no/'); my $jar = HTTP::Cookies->new; $jar->set_cookie( 1, 'message', 2 ); # I want to have Set-Cookie: mess +age=2 $jar->set_cookie( 1, 'user', 5 ); # Trying to set a second cookie $jar->add_cookie_header( $request ); my $response = $ua->request( $request ); print $response->as_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Send cookie to CGI script
by sutch (Curate) on Dec 16, 2000 at 02:56 UTC | |
|
Re: Send cookie to CGI script
by isotope (Deacon) on Dec 16, 2000 at 02:50 UTC |