In order to manage session through cookies in my HttpURLconnection I use
CookieManager cookieManager = new CookieManager();
CookieHandler.setDefault(cookieManager);
Now when I exit my app the cookies are deleted. How can I save them to SharedPreferences and reload them to the CookieManager?