eier has asked for the wisdom of the Perl Monks concerning the following question:
I receive a cookie from the server when i log in. When i open any site on that server after the login, i only get the "you have to log in" site.#!/usr/bin/perl use HTTP::Cookies::Netscape; use LWP::UserAgent; use LWP::Simple; my $browser = LWP::UserAgent->new( ); $cookie = HTTP::Cookies::Netscape->new( file => "$ENV{HOME}/nettby/cookie", autosave => 1 ); $browser->agent("Mozilla/4.0"); $browser->cookie_jar($cookie); my $response = $browser->post("http://www.nettby.no/sb_login.p +hp", { "email" => "email", "password" => "password", }); my $content = $response->content; print $content; getprint "http://www.nettby.no/user";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: login script using cookies failed
by eier (Novice) on Sep 18, 2008 at 17:36 UTC |