mbr/flask-kvsession — Issue #4: Session ID from URL instead of cookies
Author: teraom
Created: 2011-12-22 04:42:56+00:00
State: open

I am working on a web application which does not support cookies. I have implemented this application using flask and I am using server side sessions, implemented by Flask kvsession.

I am able to pass a key (session_key, dict key for store) to the browser and get it back using URL rewriting. How should I get back the session object from the keystore?

def open_session(self, app, request):
key = app.secret_key

if key is not None:
session_key = request.args.get('session_key', None)
if session_key:
session_cookie = session_key
else:
session_cookie = request.cookies.get(
app.config['SESSION_COOKIE_NAME'],
None
)

......

s = KVSession(self.serialization_method.loads(
self.store.get(sid_s))
)

are there any other things like open session that I am supposed to do?

Thanks.