httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Phillips <pa...@go2net.com>
Subject Re: general/2615: Set-Cookie not sent with Redirect response
Date Wed, 23 Dec 1998 00:29:26 GMT


On Tue, 22 Dec 1998, Rasmus Lerdorf wrote:

> > Specifically, I was unable send a Set-Cookie with a module similar to
> > mod_usertrack and using say, a RewriteRule with the 'R' flag.
> 
> Is it a module order issue?  As in did the redirect happen first and thus
> your module never got to send its cookie?  Why not just have your module
> send the redirect?  Something like:
> 
>   ap_table_set(r->headers_out, "location","http://www.apache.org");
>   r->status = REDIRECT;

This doesn't set the cookie if it was only added to headers_out, because
according to an email I have lying around from marcs when I encountered
this issue writing my own module:

   I think the current semantics are:

   headers_out        headers sent only with 200..299 and 304 responses
   err_headers_out    headers sent with all responses

Thus the cookie is not set on a 301 or 302 response code.  So, for us
the workaround was to use err_headers_out, a la:

    ap_table_addn(r->err_headers_out, "Set-Cookie", cookie);

Not obvious to the uninitiated though.

-- 
Paul Phillips      | Name something a blind person might use - A sword
Cat Juggler        |     -- heard on Family Feud
<paulp@go2net.com> | 
+1 206 447 1595    |--------* http://www.go2net.com/people/paulp/ *--------


Mime
View raw message