CGI & LWP::UserAgent - forwarding cookies - how?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I am developing a CGI application (using CGI module), which upon
processing (when user submit) will contact a second httpd server using

The issue is, I need to forward some cookies (authentication cookies) -
that the application receievd - to the second server. I know
LWP::UserAgent use HTTP::Cookies to represent it cookie jar, but I
cannot find out how I can inject a new cookie into  the jar, especially
when the cookie came from a CGI application.

Any ideas how I can do this? Can I somehow inject "raw_cookie" from CGI
directly into LWP::UserAgent?

Thanks! /

Re: CGI & LWP::UserAgent - forwarding cookies - how?

On 01/15/2007 02:25 PM, S P Arif Sahari Wibowo wrote:
Quoted text here. Click to load it

(Followups set to comp.lang.perl.misc)

perldoc lwpcook
perldoc LWP::UserAgent
perldoc HTTP::Cookies

Without seeing any code, all I can suggest is that you create a cookie
jar, add the desired cookie to it using the set_cookie method and attach
the cookie jar to an LWP::UserAgent object using LWP::UserAgent's
cookie_jar method.

Posting Guidelines for comp.lang.perl.misc:

Windows Vista and your freedom in conflict:

Site Timeline