I've been using geasessions for a while, been working great. It's simple and fast.
But today I started a new project (GAE v1.3.7) and can't get it to work, get_current_session()
just returns None
I've split the code in to a new project that's just using gaesessions:
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template
from gaesessions import get_current_session
import logging
class MainHandler(webapp.RequestHandler):
def get(self):
session = get_current_session()
logging.info(session)
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, { }))
And in the log it just says None
.
The strange part is that the other solutions it still works. (I'm guessing it's due to that the db.Model for Session is already present). Tested both the version I use there and downloaded the latest version (1.04)
I've looked at the source code for gaesessions and it kinda make sense that it returns None:
_current_session = None
def get_current_session():
"""Returns the session associated with the current request."""
return _current_session
And I can't find anywhere where the Session class is invoked, but then again it could be my laking python skills.
Does anyone use gaesession and know what's happening?