in reply to How can I store asp cookies

The Code below should enable you to store any cookie being set to a file, and enable the user agent to automagically send the cookie back to the server in any appropriate subsequent requests.

$ua->cookie_jar(HTTP::Cookies->new(file => "/path/to/file", autosave => 1));

If that doesn't work, I'd advise using something like "PlugProxy" to see exactly what request is going out. This way you can determine conclusively that the cookie is not being sent, which would suprise me (given that you have specified a cookie jar for your ua (unless of course no cookie is actually being set, which PlugProxy could also tell you)).

Plug Proxy if you want it.

Also, as holli mentioned, if you are not experienced with LWP::UserAgent and/or http, WWW::Mechanize may be the best way for you to go.


A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you

—His Holiness, The Dalai Lama

Replies are listed 'Best First'.
Re^2: How can I store asp cookies
by asp (Initiate) on Mar 16, 2005 at 08:48 UTC
    This is the way I tried it, but unfortunally the content of the file is just one line:
    #LWP-Cookies-1.0
    There is no information in it, I could use.

      If that is the case I really recomend using plug proxy (mentioned in my last reply) to look at the actualy content of the HTTP request being made, and the response fron the server. If the site is setting a cookie, the you will be able to see it in the response header.

      P.S. I'm sorry if my tone made it sound as if I did not believe you were telling the truth, that was not my intent. I am just telling you they way I would go about solving the problem you are facing.Hopefully something I suggest will help you find the solution.


      A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you

      —His Holiness, The Dalai Lama

        First, your tone did not make me upset. But thank you for your appologies.
        I rewrote the skript. Now I am using WWW::Mechanize and everything is ok now.
        Thank you very much.