Using a combination of GAE, Python, and JS, I successfully made an application connecting to the facebooks API. Only one catch: in my application - the first thing I will check is if there is a facebook cookie:
cookie = facebook.get_user_from_cookie(self.request.cookies, FACEBOOK_APP_ID, FACEBOOK_APP_SECRET) if cookie: {render index.html} else: {render login.html}
In my handler, I again check the cookie (the same code structure) to prevent people who have cookies from accessing this page. It works the way it was designed.
The only problem is that when the cookie exists, there seems to be some delay in detecting this. So the log goes:
- cookie not found in index handler, redirect to login handler
- login-handler draws login-html
- cookie found in login handler, redirect to index handler
- index-handler draws index-html
This is clearly visible to end users, the slogan draws, and then, after a second or so, the correct index screen is drawn.
What could be causing this delay? I am wondering if this is caused if a cookie is sent to the server? If so, how to code it?
source share