im trying to set Cookie for picasso connections . i found this for OkHttp:
OkHttpClient client = new OkHttpClient();
CookieManager cookieManager = new CookieManager();
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
client.setCookieHandler(cookieManager);
the problem is i dont know where to set this for Picasso . All ideas accepted ! thanks
Overriding the openConnection-Method from UrlConnectionDownloader worked for me.
To apply it to Picasso:
And take care not to use
picasso.with()
afterwards because it will initialize the builder again removing our custom downloaderCookieImageDownloader
, but instead, usepicasso.load()
directly.You'll want to use OkHttpDownloader to tie the two together: