I am setting a HttpCookie in my android application associated with a domain within the cookieManager. Then, when I stream HLS videos using exo player, I want this cookie to used for each of the .ts chunk requests.
This is the code, I use to store the cookie in the Application section of the project:
String url1 = "http://sdtest.vzvisp.com";
URI auri1 = null;
try {
auri1 = new URI(url1);
} catch (URISyntaxException e) {
e.printStackTrace();
}
AppGlobal.cookieManager = new CookieManager(null, CookiePolicy.ACCEPT_ALL);
AppGlobal.cookieManager.getCookieStore().add(auri1, new HttpCookie("JSESSIONID","aaaMp0uKke4gp"));
AppGlobal.cookieManager.getCookieStore().add(auri1,new HttpCookie("JSESSIONID1","aaaMp0uKke4gasasasp"));
AppGlobal.currentHandler = CookieHandler.getDefault();
if (AppGlobal.currentHandler != AppGlobal.cookieManager) {
CookieHandler.setDefault(AppGlobal.cookieManager);
}
This is an example of a chunk request sent :
But, when I inspect the packet, I do not see the cookie sent. Can someone kindly help me out ?
Thanks.