Code example for BasicCookieStore

0
            // set up one context for all HTTP requests so that authentication 
            // and cookies can be retained. 
            localContext = new SyncBasicHttpContext(new BasicHttpContext());
 
            // establish a local cookie store for this attempt at downloading... 
            CookieStore cookieStore = new BasicCookieStore();
            localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
 
            // and establish a credentials provider.  Default is 7 minutes. 
//            CredentialsProvider credsProvider = new AgingCredentialsProvider(7 * 60 * 1000); 
//            localContext.setAttribute(ClientContext.CREDS_PROVIDER, credsProvider); 
        } 
        return localContext;
    } 
 
 
    @Override 
    public void onCreate() { 
        singleton = this;
        PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
        super.onCreate();