Click here to get back home

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

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
CGI & LWP::UserAgent - forwarding cookies - how? S P Arif Sahari Wibowo 01-15-2007
Posted by S P Arif Sahari Wibowo on January 15, 2007, 3:25 pm
Please log in for more thread options


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/


Posted by Mumia W. (NOSPAM) on January 16, 2007, 3:33 am
Please log in for more thread options


On 01/15/2007 02:25 PM, S P Arif Sahari Wibowo wrote:
> 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


--
Windows Vista and your freedom in conflict:
http://www.securityfocus.com/columnists/420/2

Similar ThreadsPosted
Net::SSH::Perl and X11 forwarding May 18, 2005, 9:19 pm
can't retrieve all cookies with cgi.pm December 18, 2004, 11:16 pm
Storing multiple cookies June 9, 2007, 11:58 am
Coding question wrt Cookies Module February 16, 2005, 12:56 am
Not able to use LWP::UserAgent::Authenticated December 26, 2005, 9:11 pm
LWP::UserAgent and HTTP_ACCEPT January 24, 2006, 7:03 pm
LWP:Simple/LWP:UserAgent (newbie) February 24, 2005, 12:11 pm
A pipe or FH equivalent of LWP::UserAgent ? February 25, 2005, 3:12 pm
URGENT: no response - LWP::UserAgent February 26, 2005, 12:22 pm
Using HTTPS with LWP::UserAgent = Bad Service March 30, 2005, 6:45 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap