code: @Override
      public void addCookie(Cookie cookie) {
  
          if (cookie == null) {
              throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_ADD_COOKIE_0));
          }
  
          StringBuffer header = new StringBuffer(128);
  
          // name and value
          header.append(cookie.getName());
          header.append('=');
          header.append(cookie.getValue());
  
          // add version 1 / RFC 2109 specific information
          if (cookie.getVersion() == 1) {
              header.append("; Version=1");
  
              // comment
              if (cookie.getComment() != null) {
                  header.append("; Comment=");
                  header.append(cookie.getComment());
              }
          }
  
          // domain
          if (cookie.getDomain() != null) {
              header.append("; Domain=");
              header.append(cookie.getDomain());
          }
  
          // max-age / expires
          if (cookie.getMaxAge() >= 0) {
              if (cookie.getVersion() == 0) {
                  // old Netscape format
                  header.append("; Expires=");
                  long time;
                  if (cookie.getMaxAge() == 0) {
                      time = 10000L;
                  } else {
                      time = System.currentTimeMillis() + (cookie.getMaxAge() * 1000L);
                  }
                  header.append(CmsDateUtil.getOldCookieDate(time));
              } else {
                  // new RFC 2109 format
                  header.append("; Max-Age=");
                  header.append(cookie.getMaxAge());
              }
          }
  
          // path
          if (cookie.getPath() != null) {
              header.append("; Path=");
              header.append(cookie.getPath());
          }
  
          // secure
          if (cookie.getSecure()) {
              header.append("; Secure");
          }
  
          addHeader("Set-Cookie", header.toString());
      }
docs: Method overloaded from the standard HttpServletRequest API.<p>
  
  Cookies must be set directly as a header, otherwise they might not be set
  in the super class.<p>
  
  @see javax.servlet.http.HttpServletResponseWrapper#addCookie(javax.servlet.http.Cookie)