http://www.perlmonks.org?node_id=1042736

PerlSufi has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,
I want to extract cookies from a website. Particularly, JSESSIONID cookie. However, when I run the code below, nothing turns up in my file except '#LWP-Cookies-1.0'.
use LWP::UserAgent; use HTTP::Cookies; my $cookie_jar = HTTP::Cookies->new( file => 'C:\path\to\cookies.dat', + autosave=> 1); my $browser = LWP::UserAgent->new( ); $browser->cookie_jar( $cookie_jar ); $browser->get('https://example.com');
Any insight into what I'm doing wrong is greatly appreciated!