views:

37

answers:

0

I'm using gae-sessions in my App Engine program, and I have the following function:

def get_token():
    session = get_current_session()
    access_token = session.get('access_token', None)

The code that sets the session up is simple enough:

session = get_current_session()
session['access_token'] = token

I've put error trapping in to catch the case where this token is failing to be set, but it doesn't trigger.

My issue is that, when I deploy my application to AppSpot, get_token() is only returning an expected value some of the time, not all of the time. It appears to work flawlessly when running localhost.

Are there any limitations on sessions I'm not aware of that could be causing this? Has anyone got any suggestions on how I can guarantee to make session.get() return a value 100% of the time?

Cheers.