Code example for DefaultHttpClient

Methods: getCookieStore

0
    public ClientConnectionManager getConnectionManager() {
        return client.getConnectionManager();
    } 
 
    public void clearCookies() { 
        client.getCookieStore().clear();
    } 
 
 
    public static void readExternalCookies(CookieStore cookieStore) throws IOException {
        try { 
            FileInputStream fw = new FileInputStream(PreferencesActivity.getCookieFilePath(MyApp.getContext()));
            ObjectInput input = new ObjectInputStream(fw);
 
            while (true) { 
                try { 
                    SerializableCookie serializableCookie = new SerializableCookie();
                    serializableCookie.readExternal(input);
                    cookieStore.addCookie(serializableCookie);
                } catch (Exception ex) {
                    break;