• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris

sharing session/cookies between applications

Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Low Tech Laboratory
    Bookmark Topic Watch Topic
  • New Topic