Tuesday, 1 October 2013

django session lost when redirected from facebook oauth

django session lost when redirected from facebook oauth

I have a django app which is implementing Facebook oauth login.
Before an AnonymousUser, who has not yet been authenticated, is sent to
Facebook's oauth2, I store a token in the request.session.
Once the user log's in via facebook and is redirected back to our site,
the django session is lost. A new session key has been generated, the old
session key is removed from the db session store, and there is no data in
the session (so the original session token is missing). I can't figure out
why this is happening and need to get the original token?
I have the following in settings.py
SESSION_ENGINE = 'django.contrib.sessions.backends.db'
SESSION_COOKIE_DOMAIN = '.mysite.com'
SESSION_COOKIE_SECURE = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = False

No comments:

Post a Comment