类org.apache.http.impl.cookie.BasicClientCookie2源码实例Demo

下面列出了怎么用org.apache.http.impl.cookie.BasicClientCookie2的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: esigate   文件: DefaultCookieManager.java
private static Cookie rewriteForServer(Cookie cookie, DriverRequest request) {
    String name = cookie.getName();
    if ("_JSESSIONID".equalsIgnoreCase(name)) {
        name = name.substring(1);
    }
    BasicClientCookie2 httpClientCookie = new BasicClientCookie2(name, cookie.getValue());
    httpClientCookie.setSecure(false);
    String domain;
    if (request.getDriver().getConfiguration().isPreserveHost()) {
        domain = UriUtils.extractHostName(request.getOriginalRequest().getRequestLine().getUri());
    } else {
        domain = request.getBaseUrl().getHost();
    }

    httpClientCookie.setDomain(domain);
    httpClientCookie.setPath("/");
    httpClientCookie.setComment(cookie.getComment());
    httpClientCookie.setVersion(cookie.getVersion());
    return httpClientCookie;
}
 
源代码2 项目: neembuu-uploader   文件: BoxDotComAccount.java
/**
 * Set the cookie locale to en_US.
 */
private void setCookieLocale(){
    cookieStore.addCookie(new BasicClientCookie2("box_locale", "en_US"));
    cookieStore.addCookie(new BasicClientCookie2("country", "US"));
    cookieStore.addCookie(new BasicClientCookie2("lang", "en-US"));
}
 
 类所在包
 类方法
 同包方法