Saving CookieStore in the http client service

I have an Android app that makes HTTP calls. The service stores cookies in the CookieStore. I am trying to find a way to keep CookieStore, but I have not succeeded. I do not want the user to log in every time to get a new CookieStore.

I tried using SharedPreferences to store a CookieStore as a string, but I cannot rebuild a CookieStore with a String.

Has anyone else been successful in maintaining CookieStore?

+7
java android cookies
source share
2 answers

You can create your own CookieStore implementation . Keep in mind that HttpClient is not an Android technology, so you will find documentation on the Apache site (see Section 3.7).

+2
source

There is a good library for handling various aspects of HTTP requests, among which cookies are stored in the general settings: http://loopj.com/android-async-http/

(you can use the full lib or just the two classes needed to save the cookie)

+7
source

All Articles