title: Does HttpGet handle cookies automatically?
body: <p>I would like to preserve a session while connecting to server using HttpGet and I need to understand how it handles cookies.</p>
  
  <p>The server developer says that he handles all cookies stuff by himself.
  I use HttpGet request to access the server as follows:
          InputStream isResponse = null;</p>
  
  <pre><code>    HttpGet httpget = new HttpGet(strUrl);
      HttpResponse response = mClient.execute(httpget);
  
      HttpEntity entity = response.getEntity();
      isResponse = entity.getContent();
      responseBody = convertStreamToString(isResponse);
  
      return responseBody;
  </code></pre>
  
  <ol>
  <li><p>Should I do something more? Does he put the cookie on my device automatically and the HttpGet method knows to use it in order to keep the sessionID using the cookie?</p></li>
  <li><p>How can I check if the cookie exist on my device, in order to know if the session is "alive"?</p></li>
  <li><p>In case I use the following code to get the cookie:</p>
  
  <pre><code>CookieStore cookieStore = new BasicCookieStore();
  
  // Create local HTTP context
  HttpContext localContext = new BasicHttpContext();
  // Bind custom cookie store to the local context
  localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
  
  HttpGet httpget = new HttpGet(strUrl);
  HttpResponse response = mClient.execute(httpget,localContext);
  </code></pre></li>
  </ol>
  
  <p>does the HttpGet still handles the cookies the same as before?</p>
  
  <ol>
  <li>I see that DefaultHttpClient (mClient in the code above) has its own CookieStore. How can I save its cookies and load them next time I create it?</li>
  </ol>