public static String getCookieDomain(String host) {
        int level = DSSCommonConf.DSS_DOMAIN_LEVEL.getValue();
        if(host.startsWith("https://")) {
            host = host.substring(8);
        } else if(host.startsWith("http://")) {
            host = host.substring(7);
        }
        if (host.endsWith("/")) {
            host = host.substring(0, host.length() - 1);
        }
        if(DOMAIN_REGEX.matcher(host).find()) {
            String[] domains = host.split("\\.");
            int index = level;
            if (domains.length == level) {
                index = level - 1;
            } else if (domains.length < level) {
                index = domains.length;
            }
            if (index < 0) {
                return host;
            }
            String[] parsedDomains = Arrays.copyOfRange(domains, index, domains.length);
            if (parsedDomains.length < level) {
                return host;
            }
            String domain = String.join(".", parsedDomains);
            if(domains.length >= level) {
                return "." + domain;
            }
            return domain;
        }
        Matcher matcher = IP_REGEX.matcher(host);
        if(matcher.find()) {
            return matcher.group(1);
        } else {
            return host;
        }
    }
"dss.com" -> ".dss.com"
"127.0.0.1" -> "127.0.0.1"
"127.0.0.1:8080" -> "127.0.0.1"
@param host the Host in HttpRequest Headers
@return
dss-standard/sso-standard/sso-integration-standard/src/main/java/com/webank/wedatasphere/dss/standard/sso/utils/SSOHelper.java