public static String resolveCookie(HttpServletRequest httpRequest, String authCookieName) {
      Cookie[] cookies = httpRequest.getCookies();

      if (null != cookies) {
        for (int i = 0; i < cookies.length; i++) {
          Cookie c = cookies[i];
          if (c.getName().equals(authCookieName)) {
            return c.getValue().toString();
          }
        }
      }
      return "";
    }