[drakma-devel] How to handle persistent sessions across http-request calls?

Matthew Lamari matt.lamari at gmail.com
Sun Oct 26 05:04:18 UTC 2008


I acknowledge that I may be doing this wrong.

I have a very trivial hunchentoot server which merely returns a string
containing the Hunchentoot SessionID.

>From browsers, this works - subsequent requests do not result in a new
session being created.

However, even (mis?) using the cookie-jar, I end up with new sessions being
created.


(let ((jar (make-instance 'cookie-jar)))
  (labels ((doit ()
             (print (multiple-value-list (http-request
http://mysite.com/:cookie-jar jar)))
             (print (cookie-jar-cookies jar))))
    (doit)
    (doit)
    (doit)
    (cookie-jar-cookies jar)))


The cookie seems to be replaced with each call, with a new session's
cookie.  I imagine hunchentoot uses cookies to track sessions - is the old
cookie not being sent back?

Is there something I am doing wrong?  Is there a way to use Drakma to track
a persistent session?

The set-cookie comes back as hunchentoot-session=xx%yyy - where xx is the
session number.

Thanks,
Matt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/drakma-devel/attachments/20081026/ddbbef40/attachment.html>


More information about the Drakma-devel mailing list