in reply to Re: (jeffa) Re: HTTP::Cookies with LWP::UserAgent
in thread HTTP::Cookies with LWP::UserAgent

Yes, you can save the cookie to a file by specifying a file name when you create the cookie object. If you only need the cookie around for the session, then you don't need to save it, unless you don't want to re-create it next time you run your bot.

When a request is sent to the server, the cookie is neatly tucked away in the header of the request. That's how the server gets the cookie - through the browser (or the web bot in our case), which creates the header for the request.

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
  • Comment on (jeffa) 3Re: HTTP::Cookies with LWP::UserAgent

Replies are listed 'Best First'.
Re: (jeffa) 3Re: HTTP::Cookies with LWP::UserAgent
by dkode (Acolyte) on Jun 04, 2001 at 23:27 UTC
    OK, so with my script i specify a file so that each request that is sent the server knows where to locate the cookie. In that case, Why would the server send a response saying it could not set a cookie even though it is set to the cookies.txt file? Is it possible that the server only allows IE and Netscape browsers ( I have the ua set as Mozilla/4.0) I'm still stumped as to why it would not set this cookie. Very stange.