Thanks, I am not having any problems with the memcached api & python interface, that part all works as advertised.
The problem is that if you follow the deployment recipe for storing sessions in Memcached, then they always expire after 300s and there's no way to provide an expiry. Here's what's the code from deployment recipe chapter of web2py book:
from gluon.contrib.memcache import MemcacheClient
memcache_servers = ['127.0.0.1:11211']
cache.memcache = MemcacheClient(request, memcache_servers)
cache.ram = cache.disk = cache.memcache
..and..
from gluon.contrib.memdb import MEMDB
session.connect(request,response,db=MEMDB(cache.memcache))
If you do this and connect to memcached with e.g. "-vv" you can see that session data is passed in with 300s expiry. I may be missing something obvious. Can I suggest altering the API to be something like this:
session.connect(request, response, db=MEMDB(cache.memcache), session_expiry=3600)
Thanks!