Hi, Karl.
I'm Eitarow, a developer of Clack and Caveman.
> There is one thing I don't quite get: The clack.middleware.session:commit
> method uses the :id
> key in the session hash table to identify the id which should be remove from
> the store but I can't figure out how the id gets in the session hash table
> in the first place.
> Am I getting this wrong? Is this something that still has to be implemented
> or is it just not documented?
> In the latter case I could add some documentation if somebody explains the
> design to me :)
You mean, where does clack.middleware.session generate a random key
for a session?
clack.middleware.session uses clack.session.state:generate-id and it
also uses clack.util:generate-random-id.
You can change how to generate an id by setting (slot-value
{clack.session.state instance} :sid-generator) or make your own state
class inheriting clack.middleware.state.
> Another and related question is how to control the session middleware. For
> example, what is the
> intended way to expire the current session? Just set the key in the
> clack.session.options
> (I currently play around with caveman and modifying the environment directly
> is a little painful
> and doesn't feel right)?
It seems (setf (gethash :expire (getf env clack.session.options)) t)
is the only way to expire the current session.
I never realized it, but, indeed. This is painful.
I will consider better way (or you will? :) )
> Oh, and I wrote a middleware to handle postmodern connections similar to the
> clsql middleware.
> I could integrate it into clack and send a pull request or patch if there is
> interest (After I have done some
> polishing :) ).
Wow, thanks. This is probably the first time that I heard someone
wrote a Clack middleware.
Send me a pull request later.
Best Regards,
Eitarow Fukamachi