code: public void clearReferrerURLCookie(HttpServletRequest req, HttpServletResponse res, String cookieName) {
  
          String url = CookieHelper.getCookieValue(req.getCookies(), cookieName);
          if (url != null && url.length() > 0) {
              invalidateReferrerURLCookie(req, res, cookieName);
          }
      }
docs: Removes the referrer URL cookie from the HttpServletResponse if set in the
  HttpServletRequest.
  
  @param req
  @param res