gwhite has asked for the wisdom of the Perl Monks concerning the following question:

I have a client with IIS 4.0 (I have NO control over this), and the following snippet. This code works dandy on Apache, but the cookie refuses to be set on this version of IIS, (I know this because the redirect is to another Perl script which immediately tries to read the cookie and it is not there). I have multiple clients on this code base, so I am not looking for a forget cookies and do it differently solution. I am just trying to get it to work as advertised.

my $input = CGI->new(); ### bunch of other stuff ### if ($status eq APPROVED) { my $tnum = $user->db_number; my $cookie=$input->cookie(-name=>'hs_ident', -value=>"$tnum"); print "login - $status\n$tnum\n$member\n" if $Debug; print $input->redirect( -location=>"$member" , -cookie=>$cookie, - +nph=>1); }
I am using -nph, hoping that it would help, it hasn't.

g_White

Replies are listed 'Best First'.
Re: Cookies, Redirect & IIS
by waswas-fng (Curate) on Aug 06, 2003 at 19:56 UTC
    And you are sure the redirect to script is in the same realm as the cookie you had just set? One other problem I have seen is when the servers IP address and its view of hostname mismatch so IIS/browser seems to think you are trying to set a cookie for a realm the server does not exist in.

    -Waswas

      I have set the page I am redirecting to as both relative, /cgi-bin/..., and FQDN http://.../cgi-bin/...
      the two scripts exist in the same directory on the server.

      g_White
        have you verified with some sort of http head viewer that the actual header does _not_ contain the cookie? instead of relying on a 3rd party (the next cgi script)

        -Waswas