code: def get_user_from_session(session_key):
      
      session = Session.objects.get(session_key=session_key)
      session_data = session.get_decoded()
      uid = session_data.get('_auth_user_id')
      user = get_user_model().objects.filter(id=uid).first()  # get object or none
      return user
docs: Gets the user from current User model using the passed session_key
      :param session_key: django.contrib.sessions.models.Session - session_key
      :return: User instance or None if not found