docs: public static boolean hasBeenServed(final HttpServletRequest request, final HttpServletResponse response) {
          final Cookie[] cookies = request.getCookies();
          if (null == cookies || 0 == cookies.length) {
              return false;
          }
  
          Cookie cookie;
          boolean needToCreate = true;
          boolean needToAppend = true;
          JSONArray cookieJSONArray = null;
  
          try {
              for (int i = 0; i < cookies.length; i++) {
                  cookie = cookies[i];
  
                  if (!"visited".equals(cookie.getName())) {
                      continue;
                  }
  
                  final String value = URLDecoder.decode(cookie.getValue(), "UTF-8");
                  cookieJSONArray = new JSONArray(value);
                  if (null == cookieJSONArray || 0 == cookieJSONArray.length()) {
                      return false;
                  }
  
                  needToCreate = false;
  
                  for (int j = 0; j < cookieJSONArray.length(); j++) {
                      final String visitedURL = cookieJSONArray.optString(j);
  
                      if (request.getRequestURI().equals(visitedURL)) {
                          needToAppend = false;
                          return true;
                      }
                  }
              }
  
              if (needToCreate) {
                  final StringBuilder builder = new StringBuilder("[").append("\"").append(request.getRequestURI()).append("\"]");
                  final Cookie c = new Cookie("visited", URLEncoder.encode(builder.toString(), "UTF-8"));
                  c.setMaxAge(COOKIE_EXPIRY);
                  c.setPath("/");
                  response.addCookie(c);
              } else if (needToAppend) {
                  cookieJSONArray.put(request.getRequestURI());
  
                  final Cookie c = new Cookie("visited", URLEncoder.encode(cookieJSONArray.toString(), "UTF-8"));
                  c.setMaxAge(COOKIE_EXPIRY);
                  c.setPath("/");
                  response.addCookie(c);
              }
          } catch (final Exception e) {
              final Cookie c = new Cookie("visited", null);
              c.setMaxAge(0);
              c.setPath("/");
  
              response.addCookie(c);
          }
  
          return false;
      }