httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <...@joe-lewis.com>
Subject Re: Set-Cookie
Date Thu, 26 Mar 2009 15:34:16 GMT
Marco Spinetti wrote:
> Thanks very much.
> So I have to use:
>
> apr_table_add(r->headers_out, "Set-Cookie", co);
> apr_table_add(r->headers_out, "Set-Cookie", co1);

Rather than playing with a proxy or fireway gateway that could remove 
one of your set cookie headers (because you have multiple), you may want 
to combine the cookies into one.  See the Message Headers section for 
more information :

http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

Joe
>
> Best regards.
>
> Marco
>
> Rainer Jung ha scritto:
>> On 26.03.2009 10:07, Marco Spinetti wrote:
>>> Ok, I have to use apr_table_add instead od apr_table_set.
>>> So I should write:
>>>
>>> apr_table_add(r->headers_out, "Set-Cookie", co);
>>> apr_table_add(r->headers_out, "Set-Cookie", co1);
>>>
>>> If I write:
>>>
>>> apr_table_set(r->headers_out, "Set-Cookie", co);
>>> apr_table_merge(r->headers_out, "Set-Cookie", co1);
>>>
>>> is it right?
>>>
>>> What are the differences between the two approches? browser 
>>> compatibility?
>>> Best regards
>>>
>>> Marco
>>
>> Whether to merge or add
>>
>> http://apr.apache.org/docs/apr/1.3/group__apr__tables.html
>>
>> depends on whether you need the various (header) values to get 
>> concatenated with ", " in between and the header send only once, or 
>> you want the headers multiple times, each time with a different value.
>>
>> What's right depends on the spec that defines the header. Set-Cookie 
>> requires the header once for each cookie to set.
>>
>> Regards,
>>
>> Rainer
>>
>>
>>
>


-- 
Joe Lewis
Chief Nerd 	SILVERHAWK <http://www.silverhawk.net/> 	(801) 660-1900

------------------------------------------------------------------------
/If gun laws in fact worked% the sponsors of this type of legislation 
should have no difficulty drawing upon long lists of examples of crime 
rates reduced by such legislation. That they cannot do so after a 
century and a half of trying--that they must sweep under the rug the 
southern attempts at gun control in the 1870-1910 period% the 
northeastern attempts in the 1920-1939 period% the attempts at both 
Federal and State levels in 1965-1976--establishes the repeated% 
complete and inevitable failure of gun laws to control serious crime.
    --Senator Orrin Hatch% Chairman% Senate Judiciary Committee 
Subcommittee on the Constitution% 97th Cong.% 2d Sess.% The Right to 
Keep and Bear Arms% Committee Print I-IX% 1-23 (1982)./

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message