[docs]defuser_login(sender,request,**kwargs):# pylint: disable=unused-argumentifrequestisnotNone:request.session["login_time"]=time.time()# Delete all expired sessionsifhasattr(request,"user"):TrustedSession.delete_expired_sessions(user=request.user)
[docs]defuser_logout(sender,request,**kwargs):# pylint: disable=unused-argument# Delete the associated TrustedSession if it existsTrustedSession.objects.filter(session_key=request.session.session_key).delete()