[tbnl-devel] setting non-string cookies?

Edi Weitz edi at agharta.de
Sat Aug 28 19:44:38 UTC 2004


On Sat, 28 Aug 2004 15:26:36 -0400, Zach Beane <xach at xach.com> wrote:

> I just started using tbnl. I am using TBNL 0.2.9, mod_lisp 2.38,
> Apache 1.3.31, and SBCL 0.8.13.80. To test things, I created a small
> page function:
>
>    (defun xach-test ()
>      (no-cache)
>      (set-cookie "USERID" :value 1)
>      (format nil "Testing, set cookie ~A" (cookie-in "USERID")))
>
> I added this to the dispatch table with:
>
>    (push (create-prefix-dispatcher "/username" 'xach-test) *dispatch-table*)
>
> However, when I visited http://website/username, there was a delay of
> several seconds and then a blank page was shown. This showed up in the
> logs:
>
>    [Sat Aug 28 15:12:06 2004] [warn] Could not send complete body to
>    client, closing socket to Lisp
>
> I changed the number 1 to the string "1", and the page came back
> immediately with the expected answer.
>
> The documentation says that cookie values are printed as with PRINC
> when sending to the client. Does that mean that the number 1 should
> work fine? If so, any thoughts on why it gives the blank page and
> error log message?

You've caught a bug. The docs are wrong (should be "are URL-encoded"
instead of "are printed as with PRINC") and 0.2.9 didn't allow for
non-string cookie values. 0.2.10 does.

Thanks,
Edi.




More information about the Tbnl-devel mailing list