Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Dealing with session cookies

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

in reply to Dealing with session cookies


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 => "")); 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. ;-)


Replies are listed 'Best First'.
Re^2: Dealing with session cookies
by rphlb (Initiate) on Jun 29, 2004 at 18:05 UTC
    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.

      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
      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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2022-08-08 03:37 GMT
Find Nodes?
    Voting Booth?

    No recent polls found