I want to do a manual GET with cookies in order to download and parse a web page. I need to extract the security token, in order to make a post at the forum. I have complete
Assuming the cookie values are not hard-coded but obtained from a previous request, it's probably easiest to use the CookieHandler class.
CookieHandler.setDefault(new CookieManager());
Then your HttpURLConnection will automatically save any cookies it receives and send them back with the next request to the same host.