code: protected static void setCookie(
          Cookie cookie,
          boolean delete,
          HttpServletRequest request,
          HttpServletResponse response) {
  
          if (request.getAttribute(PARAM_PREDEF_OUFQN) != null) {
              // prevent the use of cookies if using a direct ou login url
              return;
          }
          int maxAge = 0;
          if (!delete) {
              // set the expiration date of the cookie to six months from today
              GregorianCalendar cal = new GregorianCalendar();
              cal.add(Calendar.MONTH, 6);
              maxAge = (int)((cal.getTimeInMillis() - System.currentTimeMillis()) / 1000);
          }
          cookie.setMaxAge(maxAge);
          // set the path
          cookie.setPath(CmsStringUtil.joinPaths(OpenCms.getStaticExportManager().getVfsPrefix(), "/system/login"));
          // set the cookie
          response.addCookie(cookie);
      }
docs: Sets the cookie in the response.<p>
  
  @param cookie the cookie to set
  @param delete flag to determine if the cookir should be deleted
  @param request the current request
  @param response the current response