Android: Unable to login to a web session and parse XML data using DOM on the same login session
<p>Android Development: I'm needing to log into a web session using POST, then make another request of which I parse XML to get Lat/Long, then submit this to a google maps overlay.  </p>

<p>My issue is I'm able to log into my system, but when I submit a command to parse XML, it is acting like a completely new session and I basically get an 'incorrect login' reply from the server.  </p>

<p>Does anyone have some simple steps to perform this...and to keep a session open for as many commands as I need?  I'm not actually SURE I'm using a session cookie, but believe this is the case.     </p>

<p>Some example code may be:
<pre><code>
try { 
URI loginUri = new URI("http://www.mywebsite.com/ExternalLogin.jsp?user=lee&amp;pwd=bluedog");
URI xmlUri = new URI("http://www.mywebsite.com/getXMLInfo.xml");</p>

// Prepares the request.
HttpClient httpClient = new DefaultHttpClient();
HttpGet loginHttpGet = new HttpGet();
loginHttpGet.setURI(loginUri);

HttpGet xmlHttpGet = new HttpGet();
xmlHttpGet.setURI(xmlUri);

// Sends the request and read the response
HttpResponse loginResponse = httpClient.execute(loginHttpGet);
InputStream loginInputStream = loginResponse.getEntity().getContent();

HttpResponse xmlResponse = httpClient.execute(xmlHttpGet);
InputStream xmlInputStream = xmlResponse.getEntity().getContent();

DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(xmlInputStream.toString()));

doc.getDocumentElement();
// Continue using DOM to parse my XML data
}
</code></pre>
