You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by naqvik <na...@infosys.com> on 2002/06/19 05:22:13 UTC

Problem sending multiple cookes in apache module

Hi,
   I tried to send two cookies using the following ways:

  1) Set-cookie: cookie1=val1;cookie2=val2

   and also as 

  2) 
  Set-cookie: cookie1=val1
  Set-cookie: cookie2=val2

  But with both the approaches, browsers( IE 5.0.x and Nescape 4.7) seem to get only the first cookie. I am using Apache 2.0 and making the call apr_table_add(r->headers_out, ...) to add the Set-cookie headers. So I am wondering where is the problem. Can some body please help me out ?

Regards,
Khushnood Naqvi

Re: Problem sending multiple cookes in apache module

Posted by Graham Leggett <mi...@sharp.fm>.
naqvik wrote:

>    I tried to send two cookies using the following ways:
> 
>   1) Set-cookie: cookie1=val1;cookie2=val2

There are many browsers out there that do not support multiple cookies 
per line. Also, I think the ; terminator is incorrect. Rather use 
separate cookies.

>   2) 
>   Set-cookie: cookie1=val1
>   Set-cookie: cookie2=val2
> 
>   But with both the approaches, browsers( IE 5.0.x and Nescape 4.7) seem to get only the first cookie. I am using Apache 2.0 and making the call apr_table_add(r->headers_out, ...) to add the Set-cookie headers. So I am wondering where is the problem. Can some body please help me out ?

Look carefully at the definitions of the apr_table functions: Some of 
them replace an existing header (so your second definition replaces your 
first one, resulting in just one cookie) while others don't.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm 
	"There's a moon
					over Bourbon Street
						tonight..."