Sets the cookie data.<p>

@param request the current request
@param response the current response
779647
public void setCookieData(HttpServletRequest request, HttpServletResponse response) {

        setCookieData(m_pcType, m_username, m_oufqn, request, response);
    }
309603
@Override
	public void removeRequest(HttpServletRequest request, HttpServletResponse response) {
		HttpUtils.removeStateParam(Config.RETURNTO_COOKIE, request, response);
	}
623420
public static void setCookie(String name, String value, int maxAge, HttpServletRequest request, HttpServletResponse response) {
		boolean httpOnly = false;
		CookieUtil.setCookie(name, value, maxAge, httpOnly, request, response);
	}
298069
public static void setCookieValue(CmsJspActionElement jsp, String name, String value) {

        Cookie[] cookies = jsp.getRequest().getCookies();
        for (int i = 0; (cookies != null) && (i < cookies.length); i++) {
            if (name.equalsIgnoreCase(cookies[i].getName())) {
                cookies[i].setValue(value);
                return;
            }
        }
        Cookie cookie = new Cookie(name, value);
        jsp.getResponse().addCookie(cookie);
    }
674257
public static void deleteCookie(String name, HttpServletRequest request, HttpServletResponse response) {
		if (name == null || name.length() == 0) {
			throw new IllegalArgumentException("cookie名称不能为空.");
		}
		CookieUtil.setCookie(name, "", -1, false, request, response);
	}
583890
public void addSeleniumCookies(HttpResponse response) {
        CookieStore cookieStore = ensureResponseHasCookieStore(response);
        CookieConverter converter = getCookieConverter();
        Set<Cookie> browserCookies = getSeleniumHelper().getCookies();
        converter.copySeleniumCookies(browserCookies, cookieStore);
    }
948012
public void addCookie(String name, String value, HttpServletResponse response) {
        Cookie cookie = new Cookie(name, value);
        cookie.setHttpOnly(httpOnly);
        cookie.setSecure(secure);
        if (StringUtils.isNotEmpty(domain)) {
            cookie.setDomain(domain);
        }
        if (StringUtils.isNotEmpty(path)) {
            cookie.setPath(path);
        }
        if (maxAge != null) {
            cookie.setMaxAge(maxAge);
        }

        response.addCookie(cookie);

        logger.debug(LOG_KEY_ADDED_COOKIE, name);
    }
885075
public void setCookies(final Cookie[] cookies) {
        this.cookies.clear();
        if (cookies != null) {
            for (final Cookie cookie : cookies) {
                cookie(cookie);
            }
        }
    }
277083
public void setRequestMetadata(@NonNull String key, @NonNull String value) {
        prefHelper_.setRequestMetadata(key, value);
    }
1306643
public static function onRequest($request, $response) {
		$request = new Request($request);
		$request->setCookieHandler([$response, 'cookie']);
		$response = new Response($response);
		Container::getInstance()
			->get(Dispatcher::class)
			->handleRequest($request, $response);
	}
945797
public void setCookieParams(TreeSet<HtmlParameter> cookieParams) {
        if (cookieParams.isEmpty()) {
            setHeader(HttpHeader.COOKIE, null);
        }

        StringBuilder sbData = new StringBuilder();

        for (HtmlParameter parameter : cookieParams) {
            if (parameter.getType() != HtmlParameter.Type.cookie) {
                continue;
            }

            String cookieName = parameter.getName();
            if (!cookieName.isEmpty()) {
                sbData.append(cookieName);
                sbData.append('=');
            }
            sbData.append(parameter.getValue());
            sbData.append("; ");
        }

        if (sbData.length() <= 2) {
            setHeader(HttpHeader.COOKIE, null);
            return;
        }

        final String data = sbData.substring(0, sbData.length() - 2);
        setHeader(HttpHeader.COOKIE, data);
    }
938966
public static Map<String, String> createCookiesMap(HttpServletRequest request) {
        Map<String, String> cookiesMap = new HashMap<String, String>();
        Cookie[] cookies = request.getCookies();

        if (ArrayUtils.isNotEmpty(cookies)) {
            for (Cookie cookie : request.getCookies()) {
                cookiesMap.put(cookie.getName(), cookie.getValue());
            }
        }

        return cookiesMap;
    }
1045861
public void setResponse(InputStream response) {
		this.response = response;
		try {
			this.responseLength = response.available();
		} catch (IOException e) {
			// This shouldn't happen.
		}
	}
1242987
public void onSessionDestruction(Request currentRequest, Session session)
	{
		HttpServletResponse response = (HttpServletResponse)httpResponse.get();
		storeSessionDataInCookie(SESSION_TOKEN_KEY, null, response);
		storeSessionDataInCookie(USER_ID_KEY, null, response);
	}
816929
public static void setCookieData(
        String pcType,
        String username,
        String oufqn,
        HttpServletRequest request,
        HttpServletResponse response) {

        // set the PC type cookie only if security dialog is enabled
        if (OpenCms.getLoginManager().isEnableSecurity() && CmsStringUtil.isNotEmpty(pcType)) {
            Cookie pcTypeCookie = getCookie(request, COOKIE_PCTYPE);
            pcTypeCookie.setValue(pcType);
            setCookie(pcTypeCookie, false, request, response);
        }

        // only store user name and OU cookies on private PC types
        if (PCTYPE_PRIVATE.equals(pcType)) {
            // set the user name cookie
            Cookie userNameCookie = getCookie(request, COOKIE_USERNAME);
            userNameCookie.setValue(username);
            setCookie(userNameCookie, false, request, response);

            // set the organizational unit cookie
            Cookie ouFqnCookie = getCookie(request, COOKIE_OUFQN);
            ouFqnCookie.setValue(oufqn);
            setCookie(ouFqnCookie, false, request, response);
        } else if (OpenCms.getLoginManager().isEnableSecurity() && PCTYPE_PUBLIC.equals(pcType)) {
            // delete user name and organizational unit cookies
            Cookie userNameCookie = getCookie(request, COOKIE_USERNAME);
            setCookie(userNameCookie, true, request, response);
            Cookie ouFqnCookie = getCookie(request, COOKIE_OUFQN);
            setCookie(ouFqnCookie, true, request, response);

        }
    }
891168
public static boolean addCookie(Cookie cookie, HttpServletResponse response) {
        if (Checker.isNotNull(cookie) && Checker.isNotNull(response)) {
            response.addCookie(cookie);
            return true;
        }
        return false;
    }
587403
public static void init(H.Request request, H.Response response) {
        H.Request.current(request);
        H.Response.current(response);
        resolveSession(request);
        resolveFlash(request);
    }