title: Django: WSGIRequest' object has no attribute 'user' on some pages?
body: <p>I want to set a cookie if user is logged in or not.</p>
  
  <p><strong>My middleware:</strong></p>
  
  <pre><code>class UserStatus(object):
      def process_response(self,request,response):
          user_status = 1 if request.user.is_authenticated() else 0
          max_age = (20)*52*7*24*60*60 # 20 years (After expiry, cookie gets deleted)
          response.set_cookie(user_status_cookie,user_status,max_age)
          return response
  </code></pre>
  
  <p>Added to <code>MIDDLEWARE_CLASSES</code> in settings.py at the end.</p>
  
  <p><strong>Problem:</strong></p>
  
  <ul>
  <li>Error: 'WSGIRequest' object has no attribute 'user'</li>
  <li>Why, when I have the Authentication and the Session middlewares active already ?</li>
  <li>Also, some pages are working smooth where as some are giving this error.</li>
  <li>What am I doing wrong ?</li>
  </ul>