Собственно index.wsgi
from beaker.middleware import SessionMiddleware
session_opts = {
'session.type': 'file',
'session.cookie_expires': 300,
'session.data_dir': './session_data',
'session.timeout': 3000,
'session.cookie_domain': '.test1.'
}
app = bottle.app()
application = SessionMiddleware(app, session_opts)
@route('/main')
def main():
s = request.environ.get('beaker.session')
s['user_id'] = s.get('user_id','aaa') * 2
s.save()
return 'Test counter: %s' % s['user_id']