use of java.net.CookieStore in project robovm by robovm.
the class CookiesTest method testCookieStoreUriDropsPath.
public void testCookieStoreUriDropsPath() throws URISyntaxException {
CookieStore cookieStore = new CookieManager().getCookieStore();
cookieStore.add(new URI("http://a.com/a/"), new HttpCookie("a", "android"));
assertEquals(Arrays.asList(new URI("http://a.com")), cookieStore.getURIs());
}
use of java.net.CookieStore in project LuaViewSDK by alibaba.
the class CookieManager method getNetRequestCookies.
/**
* net cookies
*/
private static String getNetRequestCookies() {
final CookieStore cookieStore = getCookieManager().getCookieStore();
//net cookie
if (cookieStore != null) {
final List<HttpCookie> cookies = cookieStore.getCookies();
if (cookies != null && cookies.size() > 0) {
//While joining the Cookies, use ',' or ';' as needed. Most of the server are using ';'
final String netCookie = TextUtils.join(";", cookies);
LogUtil.d(TAG, "get-net", netCookie);
return netCookie;
}
}
return null;
}
Aggregations