(I use Hunchentoot and Restas, just thought that I would mention it up here too)
I don't really know how to do this stuff in general with HTTP, so I thought that maybe posting my code would be the simplest way to show my intent:
(define-route log-in ("/log-in/" :method :post)
(multiple-value-bind (username pwd) (hunchentoot:authorization)
(cond ((and (nth-value 1 (gethash username *users*)) ;; User exists
(string= pwd (gethash username *users*)))) ;; Password is correct
;; Do something to keep track of logged in user
)))
I basically just want to let a user log in, give him some sort of way to say "hey, it's me again" and some sort of way for me to say "Oh, hey! It is you again, here you go" and then serve the user a webpage. I think that this should be done with cookies along with simply storing some value in a list that can be checked against the cookie.
How am I supposed to do this properly with Hunchentoot+Restas? Code and some explanation would be really awesome, I'm pretty lost here.