I'm using Django+Appengine on a page that has both a normal HTML request to get the page, and an AJAX request using jQuery. On normal requests, it loads the current user and session information just fine. However, for the AJAX requests, self.user isn't set and users.get_current_user() doesn't return anything.
Both handlers are on the same domain, and even in the same .py file. Using WING IDE to debug, the only difference between the two is that in the normal request, webob._parsed_cookies is set to the session id, and in the AJAX request it isn't set at all. Although, both show the same session id in request._environ.HTTP_COOKIE.
This makes me think something about it being an AJAX request rather than an HTML request is keeping GAE from knowing to load session information. Ideas?
Edit: Sorry this was my fault. I didn't realize I was using a custom user implementation of users to make it more like django rather than google users - and I had skipped a step that involved manually getting the session id out of the cookies and looking up the active user corresponding to that session id and setting it as the 'user' instance variable for the request. That is why the session id was in the request but the user object wasn't set.
- List item