You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1998/12/23 02:16:07 UTC
Re: general/2615: Set-Cookie not sent with Redirect response
>Hrm.. Are you sure about that? I use the normal r->headers_out for both
>my cookies and my redirect and it works fine. The code looks something
>like this (with all sorts of gunk removed):
>
> table_set(r->headers_out, "Location", location_str);
> r->status = REDIRECT;
> table_add(r->headers_out, "Set-Cookie", cookie_str);
> send_http_header(r);
That's because you are crafting your own response rather than using the
canned response generator in http_protocol.c (ap_send_error_response)
that gets used when a module returns REDIRECT.
>So it definitely gets sent on a 302. That brings up another question.
>REDIRECT is defined to be HTTP_MOVED_TEMPORARILY which is 302. How is
>that different from HTTP_TEMPORARY_REDIRECT 307? I never really
>understood that, but didn't care because it seemed to work.
307 was defined as a supposedly unambiguous version of 302 regarding
whether or not the redirected request should be a GET or the same method
as the orginal request. *shrug*
....Roy