[mod_python] Sessions

Tom Emerson tree at basistech.com
Mon Nov 5 11:11:11 EST 2001


Jeff Davis writes:
> 	I wanted to somehow inplement sessions in mod_python and I know it can 
> retain data between requests. My question is: does it still have access to 
> the persistant variables if a different backend answers the request? If I am 
> expecting to use sessions, I would need the variables to be consistant.

I implemented a very simple session module which mostly works --- it
worked well enough for the task I had at the time. It generates an
opaque session identifier which corresponds to the name of a file on
disk containing pickled session data.

As I look at it now, it isn't robust in the face of multiple clients
sharing the session id, but as I said it was written in about twenty
minutes for an internal app.

> 	Oh, and if anyone has some experience with existing session modules I would 
> be open to suggestion (I have seen a few around). I would prefer that it be 
> stable and somewhat scalable (I was thinking caching to a flat file 
> sequentially might not work well under all circumstances), but I don't know 
> whether that is necessary anyway.

Are there any decent ones? I remember doing a brief search and not
finding anything I immediately liked.

I'd certainly be interested in tossing my code over the fence as the
seed for a more robust session manager.

    -tree

-- 
Tom Emerson                                          Basis Technology Corp.
Sr. Computational Linguist                         http://www.basistech.com
  "Beware the lollipop of mediocrity: lick it once and you suck forever"



More information about the Mod_python mailing list