web2py supports both session and memcache. To enable sessions simply do
from gluon.contrib.gql import *
db=GQLDB()
session.connect(request,response,db)
To enable memcache
from gluon.contrib.gae_memcache import MemcacheClient
cache.ram=cache.disk=MemcacheClient()
Then every program/example that uses sessions or cache will work on gae without additional tweaks. For example:
def index():
import time
if not session.c: session.c=0
session.c+=1
return dict(counter=session.c,
time=cache.ram('time',lambda:time.ctime(),5))