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

  • Thread starter S P Arif Sahari Wibowo
  • Start date
S

S P Arif Sahari Wibowo

Hi!

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

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!

http://www.arifsaha.com/
 
G

Guest

Hi!

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

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!

http://www.arifsaha.com/

(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:
http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top