我有以下代码:
String cookieString = "sessionid=;";
CookieManager c = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
c.setCookie("https://my.url.com/someotherstuff", cookieString);
Log.v("Cookies: ", c.getCookie("https://my.url.com/someotherstuff"));
}
而不是替换" sessionid" cookie的输出是这样的:
Cookies:: sessionid=; sessionid=someIDNumber; csrftoken=someOtherIDNumber
所以它正在添加一个新的sessionid?
任何人都有解决方案吗?