Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^5: Simulating --keep-session-cookies wget option with LWP ?

by Corion (Pope)
on Sep 27, 2011 at 11:34 UTC ( #928069=note: print w/replies, xml ) Need Help??

in reply to Re^4: Simulating --keep-session-cookies wget option with LWP ?
in thread Simulating --keep-session-cookies wget option with LWP ?

Your cookie looks like this:

$VAR1 = [ 0, 'JSESSIONID', '', '/manager', 'host.local', undef, 1, undef, undef, 1, {} ];

The HTTP::Cookies documentation says about the format:

0 version 1 key 2 val 3 path 4 domain 5 port 6 path_spec 7 secure 8 expires 9 discard 10 hash

The ninth parameter, discard is 1 in your cookie. Why do you think that HTTP::UserAgent should save this cookie into a file?

As to your "negative" reputation, your nodes are currently at "-1" and "0" respectively. I downvoted both of them, because you did not do show any relevant code first, and then did no work on making the problem easily reproducible outside your specific environment.

Replies are listed 'Best First'.
Re^6: Simulating --keep-session-cookies wget option with LWP ?
by i5513 (Pilgrim) on Sep 27, 2011 at 11:57 UTC

    Thank you clarifying that issue, using ignore_discard attribute in HTTP::cookies, made the code works.

    my $cookie_jar = HTTP::Cookies->new( file => "mycookie-tomcat.cookie", autosave => 1, ignore_discard => 1 );

    I don't know if can be future problems with this option enabled. In my case (pooling tomcat manager I suppose that should not be any problem).

    Thank you again
    PD: I hope this node doesn't appear two times, if so , sorry

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928069]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2018-05-25 05:48 GMT
Find Nodes?
    Voting Booth?