Yeah so thats basically what I had to do,except if I got the Cookies
from the HttpResponse by asking for the Set-Cookie headers and placing
the values from each of the headers as the "value" for setCookie() and
just use the URL. This way I didn't have to build a string, the string
was already the proper value. Thanks for all the help!

On Jul 16, 9:02 pm, Jason Proctor <jason.android.li...@gmail.com>
wrote:
> here's your problem, i think --
>
> the getValue() method of the Apache Cookie class returns the value of
> the cookie, ie from jsessionid=blah would retrieve "blah"
>
> -- but --
>
> the setCookie() method of the WebKit CookieManager class takes a
> parameter called "value", but it's referring to something different.
> the (typically terse) doc says "the value for set-cookie: in http
> response header". my theory would be that it wants something like a
> full cookie response string, like this --
>
> name=value; expires=date; path=pathname; domain=name;
>
> given that you also pass a URL into the setCookie() method, i think
> just the name=value and expires=date elements should do it. indeed
> the doc says that setCookie() checks the expiry, so minimally you'd
> want to set that explicitly, though you could try it without.
>
> so in your code, you'd build the "value" string from the Apache
> Cookie using getName(), getValue(), and getExpiry() etc, and then
> give that to WebKit.
>
> also -- is your code actually copying any cookies? log them and make
> sure you're copying what you think you're copying.
>
> hth
>
> >I've been trying this. I get the CookieStore from the HttpClient that
> >executes the HttpPost. I then get all the values from the CookieStore
> >and place it in the CookieManager using CookiManager.getInstance
> >().setCookie(url, theCookieStore.getCookies().get(i).getValue());
> >where i is the value in whatever for loop I'm using. This still does
> >not seem to work with the WebView, because after I execute the post
> >and place the cookies in the CookieManager I attempt to load the
> >tumblr.com/iphone website and it doesn't automatically login. I'm
> >completely baffled as to what to do. I tried getting the cookies from
> >the HttpResponse, but that still didn't do anything. does the
> >CookieManager handle WebViews?
>
> --
> jason.software.particle
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to