Example usage for android.webkit CookieManager removeSessionCookies

List of usage examples for android.webkit CookieManager removeSessionCookies

Introduction

In this page you can find the example usage for android.webkit CookieManager removeSessionCookies.

Prototype

public abstract void removeSessionCookies(@Nullable ValueCallback<Boolean> callback);

Source Link

Document

Removes all session cookies, which are cookies without an expiration date.

Usage

From source file:com.jaspersoft.android.jaspermobile.cookie.LollipopCookieManager.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override/*from   w  w w . j  a  v  a  2  s .  c om*/
protected void semanticConfiguration(final String targetDomain) {
    final CookieManager cookieManager = CookieManager.getInstance();

    cookieManager.removeSessionCookies(new ValueCallback<Boolean>() {
        @Override
        public void onReceiveValue(Boolean value) {
            cookieManager.setCookie(targetDomain, StringUtils.join(getCookieStore(), ";"));
            CookieManager.getInstance().flush();
        }
    });
}