Hi, We have two servers one running a Directory Servlet in one machine and another running a Map Servlet in ANOTHER machine. I want to set some variables in session in the servlet one and retrieve it from the secnod servlet, but session data is lost in between the machines. Is there a way to pass the session data between the servlets that reside on different machines? Thank You.
Originally posted by Serdar Cabuk: Hi, We have two servers one running a Directory Servlet in one machine and another running a Map Servlet in ANOTHER machine. I want to set some variables in session in the servlet one and retrieve it from the secnod servlet, but session data is lost in between the machines. Is there a way to pass the session data between the servlets that reside on different machines? Thank You.
Hi try making yor own custom session like
Then you can Serialize your session and use it between diffrent web apps.
SOURCE CODE should be SURROUNDED by "code" tags.
Serdar Cabuk
Greenhorn
Joined: Aug 28, 2001
Posts: 2
posted
0
Actually two different JVM's are running on the machines and i need a method different from the RMI. These machines do not share the same session, this is where I lose data. Something like session migration is all that i need but how?
HttpSession is an interface. The typical HttpSession implementation is already serializable. The key point is that every object you store in a session must also be serializable. Moving a session between completely different web application contexts may not be possible. To make it easier to move user data between servers, consider putting in in a database or an Object storage system and just store the unique ID in a session. Bill ------------------ author of: