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?
On Jul 15, 1:55 pm, Jason Proctor <jason.android.li...@gmail.com> wrote: > just reverse what i did :-) > > after your request completes, get the Apache CookieStore object from > your post object (post.getCookieStore()) and copy the relevant > cookies to the WebKit CookieManager (CookieManager.getInstance()). in > theory, this should result in those cookies being sent in future > WebKit HTTP requests. > > i have more confidence that this will work than the other way round. > > > > >But how does that help you get the cookie from a POST response and > >then set the cookie on the WebView.? I can't find anyway to add a > >cookie to a custom webview > > >On Jul 15, 1:26 pm, Jason Proctor <jason.android.li...@gmail.com> > >wrote: > >> >DGupta wrote: > >> >> So I'm attempting to connect to the Tumblr Dashboard using an HTTP > >> >> Post. The Activity uses a WebView and I do an http post after creating > >> >> the webview, but the redirect_to in the HTTP Post doesn't work with > >> >> the WebView. I know my post works and isn't throwing errors, however I > >> >> need the HTTP Post to work with the webview and am completely lost on > >> >> how to. > > >> >HttpClient and WebView are completely separate engines. Operations done > >> >in one will not affect the other. > > >> >If the Tumblr POST is setting a session cookie or something, you may be > >> >able to get that out of the HttpClient cookie jar and feed it to > >> >WebView, but I have not tried that. > > >> my application combines WebKit and "native" HTTP requests, so i've > >> messed with this quite a lot. i never managed to successfully and > >> reliably communicate cookies between WebKit and the Apache HTTP > >> client. the cookies come out of the WebKit cookie manager in a > >> convenient format to inject into any request, but it seems like the > >> Apache client only occasionally takes notice of them. i've tried > >> everything from dropping them into Apache's cookie jar to setting > >> them as HTTP headers, all that. > > >> going the other way might have more success, but in my application > >> the WebKit has to establish the session. my solution was to get rid > >> of the HTTP client from my application altogether and roll my own > >> HTTP. since then i've had 100% success with cookie-sharing. > > >> -- > >> jason.software.particle > > -- > 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 -~----------~----~----~----~------~----~------~--~---