Tracking session between servers


General J2EE: Tracking session between servers

  1. Tracking session between servers (1 messages)

    I'm trying to implement something like a generic checkout for my company. The checkout application resides on one server and the client applications (there will be more than one) reside on different servers. What happens is the client servers connect to the checkout application (using the urlconnection class) and pass it some checkout information (first name, last name, etc..) via xml. The checkout application stores this in an object in the session. The checkout application then returns an xml string containing a success of failure string as well as the sessionid that was established. I now want to redirect the browser to the checkout application and make it use the same session id that I used in the first place. Here is a sample of a client application's code. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { boolean success = runTest(request); //Send and receive xml messages if(success){ Cookie sessionCookie = new Cookie("Cookie",connection.getSessionId()); response.addCookie(sessionCookie); response.sendRedirect(response.encodeRedirectURL(url)); } Any help with this would be greatly appreciated.
  2. Please let us know what are you trying to achieve by having 1 common checkout application. Are you trying to do logging of some key information from different applications? if so why not implement common logging service to central database location. The problem is session id is unique for each server and it will be a problem if 2 different server creates same sessionid at a given point. sorry if this is not that you are trying to achieve,Might be I did not get your problem correctly.