I got accustomed to using gae-sessions (
https://github.com/dound/gae-sessions) while I was building an App Engine app with webapp, so I wanted to continue using it when I switched to tipfy. Turns out to be pretty easy.
add this to your config.py:
import datetime
config['gaesessions'] = {'cookie_key': 'nunyabizniz', # use os.urandom(32).encode('hex') to generate a key
'lifetime': datetime.timedelta(hours=2), # however long you want your session to last
'cookie_only_threshold': 0} # increase this number if you want session data stored in the cookie (improves speed)
add this to your main.py
from gaesessions import SessionMiddleware
def enable_gaesessions(app):
if debug:
app._debugged_wsgi_app = SessionMiddleware(app._debugged_wsgi_app, **config['gaesessions'])
else:
app.wsgi_app = SessionMiddleware(app.wsgi_app, **config['gaesessions'])
# Instantiate the application.
app = App(rules=rules, config=config, debug=debug)
enable_gaesessions(app)
enable_appstats(app)
...
I've only tested this briefly since moving to 1.0b1, but it was working in 0.7, so should continue to work. Let me know if there's a smarter way to do this.