[kw-pm] Issue with $ENV{"HTTP_COOKIE"}

Raymond broadswd at gmail.com
Mon Jul 13 16:24:24 PDT 2009


Oops, replying to the group.

2009/7/13 Robert Pike <roberthpike at yahoo.com>:
>
> I'll try and outline this as best I can.
> I have a Perl (CGI) script that sets up a bunch of cookies (i.e. print "Set-Cookie: variable........" (it's an older script that doesn't utilize any modules such as CGI). Later in the script it redirects to another website (again a simple print statement with Location: .......).
> On that website a form is filled out, something runs on that server to process, and then the user gets redirected to a HTML page (on my server). This is a very simple HTML page that merely is set up to redirect back to the original script that generated the cookies. At this point if I try and print out what is in $ENV{"HTTP_COOKIE"} I get absolutely nothing. I was hoping to get the cookies that were originally set up in the initial call of the script.
> This does sound like a strange sequence of calls (and it has a lengthy explanation) but I would appreciate any help anyone could give. Thanks.

I'd question a couple things:

 1) Are they actually set? Check your browser's cookie store to see
if they're there or establish a telnet HTTP session and see if it's in
the response. Setting cookies and doing a HTTP redirect in the same
header doesn't work on some servers (notably older IISes).

 2) If they are set, do they have the correct url and path?

 3) Is your environment cleansing them? This is unlikely but
depending on your webserver, make sure there aren't any handlers
eating the cookies before they get to you.


More information about the kw-pm mailing list