[Web-SIG] and now for something completely different!

Titus Brown titus at caltech.edu
Sun Aug 14 19:54:25 CEST 2005


-> I think that would be useful.  Flup has a fairly decoupled session store 
-> (http://www.saddi.com/software/flup/ in 
-> http://svn.saddi.com/flup/trunk/flup/middleware/session.py).  Is there 
-> other current work that should be considered?  PythonWeb has a session 
-> module, but I don't know what its insides look like: 
-> http://www.pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/session.html
-> 
-> Paste has one too, but it's Not Very Good ;)  I started using the flup 
-> session, but I got lazy and never flipped the switch to make it the 
-> default.  There's been some discussion about sessions in the last few 
-> months on the Quixote list as well.

I've been decoupled from Web-SIG e-mails for the last two months, but
Mike Orr and I built a simple session store for Quixote that has a
fairly simple and generic storage API:

http://cafepy.com/quixote_extras/titus/session2/session2/store/SessionStore.py

With the comments deleted, here's the core API:

class SessionStore:
	def load_session(self, id, default=None):
		pass
	
	def save_session(self, session):
		pass

	def delete_session(self, session):
		pass

	def has_session(self, id):
		return self.load_session(id, None)

The only constraint is that 'id' must be a string in order for it to
work with all of the session stores.

We have implemented stores for postgres, durus, mysql, directory/file,
and shelve persistence mechanisms.

cheers,
--titus


More information about the Web-SIG mailing list