How To Get All Cookies Or Cookie's Url From Android.webkit.cookiemanager
mainly, i have loged into facebook using webview. so, i don't know which cookies for which urls are saved into CookieManager. i don't know whether it is possible or not, but i have
Solution 1:
i have solve the problem. first of all i was getting the right cookie all time. so what was the problem then. either i was wrong to integrate the cookie with Jsoup
or Jsoup was doing something wrong. so, first i have get the page with HttpUrlConnection
and then parse it with Jsoup. like this:
URLform=newURL(uri.toString());
HttpUrlConnectionconnection1= (HttpURLConnection)form.openConnection();
connection1.setRequestProperty("Cookie", my_cookie);
connection1.setReadTimeout(10000);
StringBuilderwhole=newStringBuilder();
BufferedReaderin=newBufferedReader(
newInputStreamReader(newBufferedInputStream(connection1.getInputStream())));
String inputLine;
while ((inputLine = in.readLine()) != null)
whole.append(inputLine);
in.close();
Documentdoc= Jsoup.parse(whole.toString());
any advice about this code would be appreciated.
Post a Comment for "How To Get All Cookies Or Cookie's Url From Android.webkit.cookiemanager"