On Dec 30, 2008, at 3:09 PM, Tycon wrote:
It does work for regular caching in beaker (e.g. using @beaker_cache decorator to cache controller actions etc).This is not a bug, it's basically an incorrect implementation, which uses wrong design and is completely untested. For storing sessions in mecached you need to do the same thing as when storing session in a file - pickle the session and store it as a single key in memcached. So you can update or remove the session object in a single mecached call, and all the sessions attributes will have the same expiration. Storing each session attribute as a separate record is incorrect because memcached doesn't allow you to update/iterate/delete groups of records together.
Yup, that pretty much sums it up. A recent refactor of the memcached container (the storage system Beaker uses) resulted in the session breakage. I'm not sure how easy it will be to fix this as right now the exact same container object is used whether its for caching, or for sessions. As you clearly note, in this case they should definitely have different implementations. I'll try and get this fixed before 0.9.7 final comes out (which I was hoping to do in the next few days).
Cheers, Ben
smime.p7s
Description: S/MIME cryptographic signature
