I have been developing an Android/Java application that opens up two simultaneous Apache HTTP connections. I have been developing a Chat application, and one connection is almost always running (the server was long polling; it would only respond once changes were made), and a second request to send data to the same site, using the same Session (due to being “logged in”) was needed.
After plenty of searching on StackOverflow, I have not found a good way to do this. How can this be accomplished?
The following example creates an HTTPClient from scratch. It then pulls the cookies out from another client, and adds it to its own. I’ve found this works without a hitch in Android.