• Post Reply Bookmark Topic Watch Topic
  • New Topic

sharing session/cookies between applications

 
Javed Sardar
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a scenario where I have two servlets runnings in diff contexts, Servlet A in App servers context and B in web servers context.
When logging A captures the user name and password, opens a HttpURLConnection to B and passes the user name and password which is stored in a session.
After a few navigations in A, when I call servlet B, the data I have put in B is lost
Why is this problem, dose sending data through HttpURLConnection has something to do with this?
This is the problem with cookies as well, I can set the cookies but later when I try to retrive them, then are not available.
Regards,
Javed.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have asked almost the same question before here
The fact that they are in different contexts means the serevr will do everything it can to keep them separate - it won't allow you to share information.
You will have even more problems since they are running in different servers - one in a web server and the other in an application server.
In practice, if they are running on the same server you can sometimes reach from one context into another to gather data, but this is app server dependant and therefore not very reliable.
Dave
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!