Java tutorial
//package com.java2s; import android.annotation.TargetApi; import android.os.Build; import android.webkit.CookieManager; public class Main { @TargetApi(Build.VERSION_CODES.LOLLIPOP) public static void removeAllCookies() { CookieManager cookieManager = CookieManager.getInstance(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cookieManager.removeAllCookies(null); } else { //noinspection deprecation cookieManager.removeAllCookie(); } } }