[Lispweb] Cookie help, anyone?
Alan Shields
lispweb at alan.shields.name
Fri Mar 10 00:22:20 CST 2006
On Fri, Mar 10, 2006 at 02:15:20AM +0000, Jonathon McKitrick wrote:
> I really only know enough http to get by. I'm not quite sure how the handler
> classes access cookies, and when. I'm hoping someone could help me set up a
> handler that on each file request, checks a cookie. At least, I think that's
> what I want.
In test-server.lisp inside Araneida, find the line:
url: /authenticated/test
That contains some example code. It's pretty dumb, admittedly, but it does do the
trick.
You can use that form to handle authorization for any handler.
Now, as for cookies. The method REQUEST-COOKIE returns the string value
of the cookie (that is, the parsed value for the cookie). That should
get you started.
You can also use session variables, if you're of that bent. I believe
there's documentation in the doc/ directory on session variables.
Let us know if you have more questions.
Share and enjoy,
Alan
--
"I hate to advocate drugs, alcohol, violence or insanity to anyone, but they've
always worked for me."
-- Hunter S. Thompson
More information about the lispweb
mailing list