code: public static Cookie getCookie(String name, HttpServletRequest request) {
          Cookie[] cookies = request.getCookies();
          if (ArrayUtils.isNotEmpty(cookies)) {
              for (Cookie cookie : cookies) {
                  if (cookie.getName().equals(name)) {
                      return cookie;
                  }
              }
          }
  
          return null;
      }
docs: Returns the cookie with the given name for the given request
  
  @param name      the name of the cookie
  @param request   the request where to extract the request from
  
  @return the cookie object, or null if not found