Posts

JSessionID in Android

JSessionID in Android To maintain http session with the server you can follow the following approach (Assuming you are using HttpClient for communication): Every time server starts a new session it sends one cookie names  Set-Cookie  with the value that contain the jessionid that can be used as the session ID with server. So in your code every time you make a network call to you server, check for this cookie in the response. If this cookie is present then check if it also has jessionid. following code can be used to check and parse the jessionid from the Set-Cookie header. HttpResponse response = httpClient.execute(get); switch (response.getStatusLine().getStatusCode()) {             case 200:                           parseSessionID(response);                           //process the response        ...