Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Dealing with session cookies

by arthas (Hermit)
on Jun 21, 2004 at 18:34 UTC ( [id://368525]=note: print w/replies, xml ) Need Help??


in reply to Dealing with session cookies

Hi!

Could you post some more information on the error you get, and they way you followed to deal with cookies? Anyhow, you can easily do the job using LWP. Here's an example, which I took from lwpcook man page (it becomes available on you system when you install LWP):

use LWP::UserAgent; use HTTP::Cookies; + $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1)); + # and then send requests just as you used to do $res = $ua->request(HTTP::Request->new(GET => "http://www.yahoo.no")); print $res->status_line, "\n";

Basically, this code creates a cookie jar for you and handles all cookie things automagically. It should be what you are looking for. ;-)

Michele.

Replies are listed 'Best First'.
Re^2: Dealing with session cookies
by rphlb (Initiate) on Jun 29, 2004 at 18:05 UTC
    Sorry,
    I've been away dealing with an IBM mainframe and IBM tech support, talk about issues, wow.

    Anyway, thank you for your input. I will try this, I've never dealt with the LWP stuff before, cookies I have, but not in this manner before. I see that quite a lot of folks out there ask you guys about cookies a lot. Almost like a book could be written on just that, cookies and dealing with them. With Perl being TIMTOWDI, I would assume there is more than one way to do this, dealing with ASP and sesion cookies. BTW, U asked about the error message from ASP, here it is:
    "Microsoft VBScript runtime error '800a0005'
    Invalid procedure call or argument: 'Mid'
    /webdms/login.asp, line 440"

    I will check back with this a bit later this week. Thanks again for all of the help.

      Michele
      You also asked how I am doing the call to get the web page, been a lot going on around here today, I apologize for that.

      I've used a standard issue cgi GET, as in,
      "$result = GET $url"
      Within the $url variable is also the
      "?id=$id&password=$psw...."
      This gave me the error msg I showed a bit earlier. I "See" the cookie come through as parsed data, which I think I can use the LWP stuff to send it back, that appears to be what my troubles are, getting the cookie back to the ASP program.

      If there is more to do with this, please let me know, thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://368525]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-18 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found