On Tuesday 08 February 2005 02:24, Stephen Deasey wrote:
sourceforge, plus the following additional items:
>
> Added a simple cookie API in C and Tcl.
>

Check out a tcl version of cookie code. It reads the Cookie header and writes
both Set-Cookie and Set-Cookie2 headers. I believe it parses correctly,
char-by-char, avoiding regexp. It is efficient in that it only runs once per
connection, so if you need multiple cookies, you don't hunt through all the
headers for every one.
<http://rmadilo.com/m2/servers/jnm/modules/tcl/twt/packages/cookie/tcl/>

The package writes correct cookies with the exception of the path and max-age
attributes. After developing the code, I discovered a bug in the Mozilla
codebase, which includes Netscape and Firefox, where the surrounding quotes
were not removed from either path or max-age. This caused the cookie to not
be returned when path was set (it never matched), and/or for the cookie to be
set as a session cookie if max-age was sent (since "800", with the quotes,
isn't an integer value). The bug may be fixed by now, but I have no idea how
long it has been there. Mozilla doesn't recognize the Set-Cookie2 header, so
quotes could be added here without effect.


tom jackson


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to