Shared cookies between WebView and HTTPClient?

The Android app I am creating requires web authentication for users to make data calls. In Adobe AIR, and then on the iPhone, we did this by providing a web page login page equivalent to web browsing, and set a cookie when a user logs in. Subsequent data calls use the same Cookie Jar and are therefore considered authenticated.

In the Android version, I authenticate the user using WebView, and then, as soon as this is done, I make a data call using DefaultHttpClient, however I can not load the data during the second call.

Are there any cookies that I don’t have? I assume both HTTPClient and WebView will use the same cookie space. I am wrong?

+4
source share
1 answer

Here is my piece of code that finally worked (its pseudo code, as in some parts of it, was torn out of my project, and some things, like calling MyApplication via Singleton, were more to illustrate what to do, not how do it using best practices):

http://gist.github.com/610754

+8
source

Source: https://habr.com/ru/post/1310431/


All Articles