code: public static void setCookieForRequestParameter(HttpServletRequest request, HttpServletResponse response, String id, String state, boolean isHttpsRequest, ConvergedClientConfig clientCfg) {
          //OidcClientConfigImpl clientCfg = activatedOidcClientImpl.getOidcClientConfig(request, id);
          Map<String, String[]> map = request.getParameterMap(); // at least it gets state parameter
          JsonObject jsonObject = new JsonObject();
          Set<Map.Entry<String, String[]>> entries = map.entrySet();
          for (Map.Entry<String, String[]> entry : entries) {
              String key = entry.getKey();
              if (Constants.ACCESS_TOKEN.equals(key) || Constants.ID_TOKEN.equals(key)) {
                  continue;
              }
              String[] strs = entry.getValue();
              if (strs != null && strs.length > 0) {
                  jsonObject.addProperty(key, strs[0]);
              }
          }
          String requestParameters = jsonObject.toString();
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "requestParameters:" + requestParameters);
          }
          String encodedReqParams = null;
          try {
              encodedReqParams = Base64Coder.toString(Base64Coder.base64Encode(requestParameters.getBytes(ClientConstants.CHARSET)));
          } catch (UnsupportedEncodingException e) {
              //This should not happen, we are using UTF-8
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "get unexpected exception", e);
              }
          }
  
          String encodedHash = null;
          if (encodedReqParams != null) {
              encodedHash = calculateOidcCodeCookieValue(encodedReqParams, clientCfg);
          }
          Cookie c = OidcClientUtil.createCookie(ClientConstants.WAS_OIDC_CODE, encodedHash, request);
          if (clientCfg.isHttpsRequired() && isHttpsRequest) {
              c.setSecure(true);
          }
          response.addCookie(c);
      }
docs: set the code cookie during authentication