Code example for BasicClientCookie

Methods: setDomain, setPath

0
                "Apache-HttpClient/potdroid " + mSettings.getString("unique_uagent", "potdroid"));
 
        // check if login cookie exists. If so, attach it to the 
        // http client 
        if (mSettings.contains("cookie_name")) {
            BasicClientCookie cookie = new BasicClientCookie(mSettings.getString("cookie_name",
                    null), mSettings.getString("cookie_value", null));
            cookie.setPath(mSettings.getString("cookie_path", null));
            cookie.setDomain(mSettings.getString("cookie_url", null));
            mHttpClient.getCookieStore().addCookie(cookie);
        } 
    } 
 
    /** 
     * Get a xml document from the mods.de api 
     * @throws NoConnectionException  
     */ 
    public Document getDocument(String url) throws NoConnectionException {
        Document document;
         
        // no internet connection...