On Thu Aug 20 18:09:23 2009, MKANAT wrote:
Show quoted text> Under mod_perl 2, when calling $cgi->redirect, if you also send cookies
> at the same time, it sends a 200 OK instead of a 302 Found. It's
> possible that this only happens when we also send page content along
> with the 302 (though I haven't confirmed that myself).
>
> This comment describes the problem:
>
>
https://bugzilla.mozilla.org/show_bug.cgi?id=376044#c34
I think we addressed this in a recent release in a patch to the
documentation, clarifying this point:
"All names arguments recognized by header() are also recognized by
redirect(). However, most HTTP headers, including those generated by
-cookie and -target, are ignored by the browser."
Microsoft admits their server doesn't even send the cookie in this case:
http://support.microsoft.com/kb/176113
This article has a reference back to the HTTP spec in comment 4:
http://www.persistall.com/archive/2008/01/25/cookies--redirects--nightmares.aspx
The relevant bit is here:
"The HTTP 1.0 standard per
http://www.w3.org/Protocols/rfc2109/rfc2109
in section "4.3.5 Sending Cookies in Unverifiable Transactions" says
that cookies should not be set from unverifiable transactions. It states
specifically that "Unverifiable transactions typically arise when a user
agent automatically requests inlined or embedded entities or when it
resolves redirection (3xx) responses from an origin server." So,
"Set-Cookie" is not to be acted upon by browsers / user agents for 3xx
redirects. Nothing in HTTP 1.1 changes this part of HTTP."
Therefore, my conclusion is that the bug here is in your application.
CGI.pm is doing it's part now by clearing stating in the documentation
that while you technically can combine cookies and redirection, you
should not do it.
Mark