in reply to Re^2: LWP ignoring cookies??
in thread LWP ignoring cookies??

Ok, this worked...
my $ua = LWP::UserAgent->new( cookie_jar =>HTTP::Cookies->new( file => + '/tmp/cookies.txt', autosave => 1, ignore_discard => 1 ));
and then I had to make sure that /tmp/cookies.txt exists, and that it's accessable. Silly though - I would have expected the in-memory cookie jar to operate...

Replies are listed 'Best First'.
Re^4: LWP ignoring cookies??
by alexm (Chaplain) on Jan 05, 2008 at 18:17 UTC
    use LWP; my $ua = LWP::UserAgent->new; $ua->cookie_jar({}); my $response = $ua->get('http://www.google.com/'); use Data::Dumper; print Dumper($ua);
    Proof of concept that it works fine with {} as the cookie jar.
Re^4: LWP ignoring cookies??
by Anonymous Monk on Jan 05, 2008 at 11:27 UTC
    in memory should work, do you have latest LWP?
      Hi all - thanks for all your help. I've determined that the problem I'm experiencing may actually reside within Wordpress, and the way it determines if cookies are enabled or not. My own PHP code that sets and retrieves a cookie works fine when called from LWP, so I'm happy that LWP is not at fault.. ;-) Now to debug Wordpress.... Oi.......