code: public String createStateCookie(HttpServletRequest request, HttpServletResponse response) {
          String stateValue = SocialUtil.generateRandom();
          String loginHint = socialWebUtils.getLoginHint(request);
          if (!request.getMethod().equalsIgnoreCase("GET") && loginHint != null) {
              stateValue = stateValue + loginHint;
          }
          if (tc.isDebugEnabled()) {
              Tr.debug(tc, "Setting cookie " + ClientConstants.COOKIE_NAME_STATE_KEY + " to " + stateValue);
          }
          Cookie stateCookie = referrerURLCookieHandler.createCookie(ClientConstants.COOKIE_NAME_STATE_KEY, stateValue, request);
          response.addCookie(stateCookie);
          return stateValue;
      }
docs: Generates a random state value, adds a cookie to the response with that value, and returns the value.