In my Android app, I am trying to switch from android-async-http
to okhttp
which supports async networking sind version 2.0. While the former ships
You can set your CookieStore in the OkHttp client with the following code:
OkHttpClient client = new OkHttpClient();
client.setCookieHandler(new CookieManager(
new PersistentCookieStore(getApplicationContext()),
CookiePolicy.ACCEPT_ALL));
I made a gist with my implementation of a persistent CookieStore trying to improve janoliver's answer in two points: