httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Moore-Oliva <j...@chatgris.com>
Subject Re: BUG: Apache::Cookie doesn't handle 0
Date Wed, 09 Oct 2002 21:40:01 GMT
>From what I saw on the C interface, the cookie values are name//value
STRING pairs...

And since a 0 byte marks the end of a string in C, the value is cut off
at the zero byte because it is the end of the string...

In addition, (this part I am unsure of) but I believe that cookies are
only supposed to hold printable characters anyways...

Josh.

On Wed, 2002-10-09 at 17:06, Michael McLagan wrote:
> Hello,
> 
>    I posted this to mod_perl's list about a month ago and didn't see much 
> comment other than my being berated for being clueless so I thought I might 
> send it here to see if it generated a more positive result.
> 
> -------- Original Message --------
>    There is a bug in Apache::Cookie.  It doesn't handle a cookie with a zero 
> byte in it!
>  
> $value = "ABCD" . chr(0) . "EFGH";
> $cookie = Apache::Cookie->new($request, -name=> 'oatmeal', -value=>
> $value, -domain=>$ENV{'SERVER_NAME'}, -path=>"/"); print
> $cookie->as_string;
> 
> The output looks like:
>  
>    oatmeal=ABCD; domain=my.web.server.com; path=/; expires=0
>  
> Where did the rest of my cookie go?!
>  
> Should I not have gotten:
> 
>    oatmeal=ABCD%00EFGH; domain=my.web.server.com; path=/; expires=0
> 
> -------- Original Message --------
>  
> Please CC me on replies, I'm not on the list.
> 
>    Michael



Mime
View raw message