M
marmot101
Hi, All,
Using CGI, I get a response from server which plant a Cookie in client
machine. Now I can get this Cookie, but I don't know how to print out the
value of this Cookie? I checked online manual, but seems none method works.
Can anyone help me?
Many thanks!
marmot101
############## My Source Code ####################
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Cookies;
use HTTP::Request::Common qw(POST);
my $agent = LWP::UserAgent->new();
my $url = 'http://***';
my $content = [ 'UserName' => '***', 'Password' => '***' ];
my $request = POST $url, $content;
my $response = $agent->request($request);
if ($response->is_success) {
print "Yes, it is success\n";
print $response->content;
$cookie_jar = new HTTP::Cookies->new;
$cookie_jar->extract_cookies($response);
# How to print out value of Cookie here?
# print "Cookie = ", $cookie_jar{'Stamp'}->value; # doesn't work
}
Using CGI, I get a response from server which plant a Cookie in client
machine. Now I can get this Cookie, but I don't know how to print out the
value of this Cookie? I checked online manual, but seems none method works.
Can anyone help me?
Many thanks!
marmot101
############## My Source Code ####################
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Cookies;
use HTTP::Request::Common qw(POST);
my $agent = LWP::UserAgent->new();
my $url = 'http://***';
my $content = [ 'UserName' => '***', 'Password' => '***' ];
my $request = POST $url, $content;
my $response = $agent->request($request);
if ($response->is_success) {
print "Yes, it is success\n";
print $response->content;
$cookie_jar = new HTTP::Cookies->new;
$cookie_jar->extract_cookies($response);
# How to print out value of Cookie here?
# print "Cookie = ", $cookie_jar{'Stamp'}->value; # doesn't work
}