Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

No more 302 error, just no cookie info with POST?

by inblosam (Monk)
on May 22, 2002 at 20:16 UTC ( [id://168573]=note: print w/replies, xml ) Need Help??


in reply to Re: HTTP 302 error now??
in thread LWP, extract_cookies, etc.

IlyaM: You have been great!

It still doesn't post the data and gives me what seems to be the screen that would show up if someone was not logged in. I used your newest code (just a note, I had to add a ");" on the end of line 12) and it gave me the following in the header of the page returned:
HTTP/1.1 200 OK Connection: close Date: Wed, 22 May 2002 19:56:15 GMT Server: Microsoft-IIS/5.0 Content-Type: text/html Expires: 0 Client-Date: Wed, 22 May 2002 19:58:47 GMT Client-Response-Num: 1 Page-Completion-Status: Normal Page-Completion-Status: Normal Set-Cookie: CFGLOBALS=HITCOUNT%3D46%23LASTVISIT%3D%7Bts+%272002%2D05%2 +D22+12%3A56%3A16%27%7D%23TIMECREATED%3D%7Bts+%272002%2D05%2D20+23%3A4 +7%3A29%27%7D%23; expires=Sun, 27-Sep-2037 00:00:00 GMT; path=/; Set-Cookie: LASTVISIT=%7Bts+%272002%2D05%2D22+12%3A56%3A16%27%7D; expi +res=Sun, 27-Sep-2037 00:00:00 GMT; path=/; Set-Cookie: SID=99999999999999999999; expires=Fri, 21-Jun-2002 12:56:1 +6 GMT; path=/; Title: Page Title
The rest of the page comes up with their default signup form (when you are in the member area and not logged in?). Any ideas? It doesn't seem like the cookie is being passed with the second POST request. THANKS!

Edit by dws for code tags and formatting

Replies are listed 'Best First'.
Re: No more 302 error, just no cookie info with POST?
by IlyaM (Parson) on May 22, 2002 at 21:07 UTC
    It is hard to say what is wrong. You should try to turn on debug output in LWP::UserAgent. See LWP::Debug. For example if you add following code into your script it will turn on all debug prints inside LWP::UserAgent.
    use use LWP::Debug qw(+);
    Particullary you will be able to see all redirects and all headers. It will show you if you do recieve cookie in response for first request and if it sent back later in second request.

    --
    Ilya Martynov (http://martynov.org/)

      I turned on LWP debug and the only thing that seems like an error is this:

      LWP::UserAgent::_need_proxy: Not proxied


      Is that the problem why my POST is not POSTing? Or is there something else to look for in the debug results? THANKS!!

      Michael Jensen
      michael at inshift.com
      http://www.inshift.com
        I found this node discussing the WinProxy. I know the box I am trying to POST to runs IIS (blah). Could this help me? How do I insert this into the header, if so? Below is an excerpt about winproxy I found. see full node 56141
        GET /index.html HTTP/1.0 Host: www.google.com

        Now this works on virtually every proxy. Except WinProxy. WinProxy requires an additional header, as well as browser identification, so the same request would look like this:
        GET / HTTP/1.0 Host: www.google.com User-agent: Mozilla/4.7 Remote-Host-Wp: 10.0.3.82

        Any help would be greatly appreciated!!

        Michael Jensen
        michael at inshift.com
        http://www.inshift.com

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found