title: Django not detecting logged in user upon redirect back from external page
body: <p>I'm sending a user off-site to register on another service, and then as they are redirected back to a specific URL on my site I'm firing the view listed below:</p>
  
  <pre><code>#views.py
  
  class OAuthView(View):
  
      def get(self, request, *args, **kwargs):
          if request.user.is_authenticated():
              #do things
          else:
              #return HttpReponse with error message
  </code></pre>
  
  <p>I would say that I'm just not logging users in properly, but I use braces' LoginRequiredMixin elsewhere on the site, and that works fine after the user is logged in, but before they are directed off-site. </p>
  
  <p>The weird thing is that after being redirected back to my site and seeing the error message triggered from OAuthView, LoginRequiredMixin no longer works for the pages it used to. It's as if the user has been logged out by being redirected off-site.</p>
  
  <p>Even weirder is that I'm using the default sessions backend, and when I check the current session within admin, it says that the session is still active for the user who can no longer see pages with the LoginRequiredMixin. </p>
  
  <p>So - session is still valid, but user seems to be logged out. How can I test to find out more information about this problem?</p>