Android cookie (edit)


In Android, CookieManager is all cookie management both WebView and HttpClient.

Clear All Cookies


Get cookie string

String str = CookieManager.getInstance().getCookie("");

This is whole cookie string. ex) abc=test;app=12345;

If you want to pick each items,

for (String cookieset : str.split(";")) {
   String value2[] = cookieset.split("=");
   // value2[0] : key
   // value2[1] : value

Set cookie

CookieManager.getInstance().setCookie("url", value);

In Android, we need to set url and value

Compore to iOS

iOS has features to get all cookies in iOS device.
Android doesn’t have this feature