Code example for BasicCookieStore

0
 
		if (HttpHelper.contexts.containsKey(host)) {
			return HttpHelper.contexts.get(host);
		} else { 
			HttpContext context = new BasicHttpContext();
			CookieStore cookieStore = new BasicCookieStore();
			context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
 
			HttpHelper.contexts.put(host, context);
			return context;
		} 
	} 
 
	/** 
	 * Simple way to turn an input stream to a string 
	 *  
	 * @param is 
	 *            the input stream 
	 * @return the string 
	 */