Hello BURAK,
Yes, the current implementation is indeed broken and there are plenty of RFC-compatible cookie strings which it doesn't handle. I'm inclined to use the even more forgiving
$delimiter = '[;,] *';
as it doesn't appear to cause any problems and my reading of RFC 2965 suggests that more than single whitespaces may be present.
If you have no objections, this is the pattern I will use in the forthcoming release.
Thanks very much for your bug report and suggestions,
Pete
On Tue Jan 15 09:18:28 2008, BURAK wrote:
Show quoted text> This code:
>
> $delimiter = ';\s+';
>
> must be replaced with:
>
> $delimiter = '[;,] ?';
>
> in order to handle cookies correctly. Current implementation is broken
> with this kind of cookies for example:
>
> $ENV{HTTP_COOKIE} = q{a=b;foo=bar}
>
> Note: I took the '[;,] ?' regex from Lincoln Stein's CGI::Cookie.