title: Android session management
body: <p>Is there a specific library for Android session management? I need to manage my sessions in a normal Android app. not in <code>WebView</code>. I can set the session from my post method. But when I send another request that session is lost. Can someone help me with this matter?</p>
  
  <pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();
  HttpPost httppost = new HttpPost("My url");
  
  HttpResponse response = httpClient.execute(httppost);
  List&lt;Cookie&gt; cookies = httpClient.getCookieStore().getCookies();
  
  if (cookies.isEmpty()) {
      System.out.println("None");
  } else {
      for (int i = 0; i &lt; cookies.size(); i++) {
          System.out.println("- " + cookies.get(i).toString());
      }
  }
  </code></pre>
  
  <p>When I try to access the same host that session is lost:</p>
  
  <pre><code>HttpGet httpGet = new HttpGet("my url 2");
  HttpResponse response = httpClient.execute(httpGet);
  </code></pre>
  
  <p>I get the login page response body.</p>