PDA

View Full Version : Cookies & me


Benson
03-09-1999, 04:55 PM
I had a feedback form set up on my old server so that after submitting the form, the following ack page used a cookie to say "Thanks, Joe, for blah bleh bluh". Ever since moving the stuff over to FQ, the feature isn't working. As I recall, the cookie was set on the form page with onBlur or some such. That part still works at FQ because I can see the cookie. A file called cookie.pl, which allows cookies to be used with SSI's, might be the problem. It's called on the ack page like this:

#exec cmd="/big/dom/xmxmdesign/cgi-bin/cookie.pl mxm-name"

(I don't think I used to use the full path like this indicates, but anyway..)

This is cookie.pl:

#!/usr/bin/perl

# This script lets cookies
# be used with SSI's

foreach (split(/; /, $ENV{'HTTP_COOKIE'})) {
($chip,$value) = split(/=/);
$cookie{$chip} = $value;
}

print "$cookie{$ARGV[0]}";

I've made sure that there is a trailing space before the closing comment tag in the SSI, no line breaks, etc. There is another SSI on the page to bring up the header-it works fine.

Any general ideas? Is there an easier way to bring "forward" the submitter's first name to the ack page?

ChrisH
03-09-1999, 10:59 PM
General ideas:

(a) make sure the script runs from
the command line in the cgi-bin dir.

(b) set the cgi-bin environment variables
at the shell, run it, and see if it still
works, and actually gives the right
result. Something along the lines of

HTTP_COOKIE="mxm-name=Joe"

at the shell, then run the script as in
(a). It should print the name.

(c) If the cookie is set in your
browser, you could try to go to the
cgi-bin directly, though it looks like
it probably doesn't send out cgi-bin
headers, so you'll get a server error.

(d) Well, (c) was pretty bad already,
so there is no (d) . . .


ch