|
Posted by Mumia W. on February 23, 2007, 5:44 am
Please log in for more thread options
On 02/23/2007 02:29 AM, greenrob wrote:
> Hi guys,
>
> I am working on a simple script using WWW:Mechanize to extract flight
> details and everything works perferectly. However, I come to a road
> block when I tried to extract the session cookies. I've been digging
> around the internet/newsgroup for the last couple of days but still to
> no avail...
>
> When I turned on the debug routine for LWP, this is what I can see
>
> LWP::UserAgent::new: ()
> aeroperlas(debug) - Submitting initial search request
> LWP::UserAgent::request: ()
> HTTP::Cookies::add_cookie_header: Checking www.e-savtravel.com for
> cookies
> HTTP::Cookies::add_cookie_header: Checking .e-savtravel.com for
> cookies
> HTTP::Cookies::add_cookie_header: Checking e-savtravel.com for cookies
> HTTP::Cookies::add_cookie_header: Checking .com for cookies
> LWP::UserAgent::send_request: GET
https://www.e-savtravel.com/wlvirtual/jdmm001.
> asp?
> wtipo=RT&wclase=E&wnadult=1&wnchild=0&wninfant=0&wnum=0&wnsenior=0&wrd0074a=
>
PAC&wrh0074a=BOC&wfc0076a=02/23/2007&wrd0074a1=BOC&wrh0074a1=PAC&wfc0076a1=02/25
> /
> 2007&wrd0074a2=&wrh0074a2=&wfc0076a2=&wrd0074a3=&wrh0074a3=&wfc0076a3=&wusu_rad
> io=0&wop=S&wtipofare=I
> LWP::UserAgent::_need_proxy: Not proxied
> LWP::Protocol::http::request: ()
> LWP::Protocol::collect: read 471 bytes
> HTTP::Cookies::extract_cookies: Set cookie ASPSESSIONIDASSTCCRQ =>
> PNOPBCFDGPDDDGCNOKLBIJKA
>
> So as can be seen, the Mechanize/LWP did handle the cookie
> automatically at this line
>
> "HTTP::Cookies::extract_cookies: Set cookie ASPSESSIONIDASSTCCRQ =>
> PNOPBCFDGPDDDGCNOKLBIJKA"
>
> Question, how do I write code using HTTP::Cookie etc to extract this
> data out ?? I need to use this session cookie later (of course just a
> very short interval later while the session cookie is still
> effective) ..
>
> Thanks a lot in advance ...
>
> rgds
> Rob
>
Are you sure you need to extract it? You didn't show any code, so it
won't be possible for people to give you specific help, but I'll bet all
you have to do is to create a persistent cookie object for
WWW::Mechanize to use.
Start->Run->"perldoc HTTP::Cookies"
Start->Run->"perldoc WWW::Mechanize"
--
Windows Vista and your freedom in conflict:
http://www.badvista.org/
|