Android cookie (edit)

Cookie

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

Clear All Cookies

 CookieManager.getInstance().removeAllCookie();
 CookieSyncManager.getInstance().sync();

Get cookie string

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

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