title: How to use session to work between php webservices and android
body: <p>I have an android application which uses php webservices. I have created the login.php which will validates the username, password sent from the android application. Once validated, a session is created such as follows:</p>
  
  <pre><code>session_start();
  $_SESSION['userId'] = $id;
  $_SESSION['username'] = $username;
  </code></pre>
  
  <p>On the client-side I have this:</p>
  
  <pre><code>HttpContext httpContext = new BasicHttpContext();
  HttpResponse httpResponse = httpClient.execute(httpPost, httpContext);
  HttpEntity entity = httpResponse.getEntity();
  </code></pre>
  
  <p>When I debug, I see that the httpReponse contains a PHPSESSID. I do know that I will need this information for comparison between the session_id on the server-side before executing any queries. </p>
  
  <p>However, I do not know how to retrieve this "Set-Cookie" and send it to the server-side for comparison? A piece of code or tutorial will be extremely helpful. </p>
  
  <p>Thank you </p>