In my application I send a POST request to a server, and receive a response from the server. And from the response I gather different cookies, user information specifically. So,
This code worked fine for me prior to KitKat 4.4 update -
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
//handle cookies
CookieManager cookieManager = new CookieManager();
CookieHandler.setDefault(cookieManager);
It broke after 4.4.2 (at least that's when I noticed it), and cookies were no longer received. Simply moving the CookieManager and CookieHandler before opening the urlConnection fixed it again .. bizarre that it worked before! eg.
//handle cookies
CookieManager cookieManager = new CookieManager();
CookieHandler.setDefault(cookieManager);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();