def METHOD_NAME(request):
    try:
        ban_cache = request.session[CACHE_SESSION_KEY]
        ban_cache = _hydrate_session_cache(ban_cache)
        if ban_cache["ip"] != request.user_ip:
            return None
        if ban_cache["version"] != request.cache_versions[BANS_CACHE]:
            return None
        if ban_cache.get("expires_on"):
            if ban_cache["expires_on"] < timezone.today():
                return None
        return ban_cache
    except KeyError:
        return None