remove Expired Cookie - Android Network

Android examples for Network:Cookie

Description

remove Expired Cookie

Demo Code


//package com.java2s;
import android.content.Context;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;

public class Main {
    public static void removeExpiredCookie(Context context) {
        if (context != null) {
            CookieSyncManager.createInstance(context);
            CookieManager.getInstance().removeExpiredCookie();
            CookieSyncManager.getInstance().sync();
        }/*  w ww .  ja v  a  2 s. c  o m*/
    }
}

Related Tutorials