title: why keyError in session when logout?
body: <p>I set <code>session["logID"]</code> in register and login functions in my view but when I want to save it in the DB when user logs out then I get <code>Loginstatus matching query does not exist.</code>  in django. here is my functions in <code>views.py</code>: </p>
  
  <pre><code>def loginProcess(request, email, password):
      try:
          user = authenticate(username=User.objects.get(email=email).username, password=password)
      except ObjectDoesNotExist:
          user = None
      if user is not None:
          # some code here for create LoginStatus model Object
          request.session["logID"] = newLoginStatus.id
          return showProfile(request)
      else:
          return homepage(request)
  
  def logoutProcess(request):
      # ...
      userLoginStatus = Loginstatus.objects.get(pk=request.session.get("logID"))  # I got Error here
      userLoginStatus.sessionData = userSessionData
      userLoginStatus.save()
      logout(request)
      return redirect('/')
  </code></pre>
  
  <p>I got the <code>Loginstatus matching query does not exist.</code> in server so <code>session["logID"]</code> doesn't exist!! but I set it in <code>loginProcess</code> and <code>userLoginStatus</code> succesfully saved in DB !!!! I don't understand what happens.</p>