• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session maintenence in different containers

 
nalini peddareddy
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could anyone please tell me as of how the session is maintained in two applications in two different containers.


Thanks in advance
Nalini.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short answer - session can not be shared by two web application, the whole security design in servlets is to keep web applications separate.
If you want to share information between applications you will have to program something that does not rely on session.
Bill
 
stan ioffe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add to Bill's point, you're going to have to create your own "checking system" ... For example, store some kind of unique key in a database that both applications will have access to.

Since you cannot use session, you're going to have to bind that key to a person's login, and have some kind of a flag that determines whether or not this login has already been activated by the other application. Then if it has, you could have another field which will keep a hash of all the name/value pairs that you would usually put into a session which both web apps will need to parse and maintain every time something needs to be added or deleted from the database ...

In any case, it's going to get really complicated, really fast. Are you sure you can't do without having a session for both applications??

-stan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!