views:

366

answers:

1

I have a Service for my Android app that performs HTTP calls. The Service stores cookies in a CookieStore. I am trying to find a way to persist the CookieStore but I haven't been successful. I don't want the user to log in every time to receive a new CookieStore.

I tried to use SharedPreferences to store the CookieStore as a string, but I can't re-construct the CookieStore with a String.

Has anyone else had success in persisting a CookieStore?

+1  A: 

You can create your own CookieStore implementation. Bear in mind that HttpClient isn't an Android-specific technology, so you will find some documentation over at the Apache site (see section 3.7).

CommonsWare
thanks mark. looked at the documentation more closely, i ended up writing out the entire cookiestore as a string to sharedprefs. then when reading the string back in i had to parse out each cookie manually