How do I share a session between two Web applications?

How do I share a session between two Web applications?

Technically, session between two web application (two different WARs) cannot be shared. This is by design and done for security reasons.

What is web session state?

Session state, in the context of . NET, is a method keep track of the a user session during a series of HTTP requests. Session state allows a developer to store data about a user as he/she navigates through ASP.NET web pages in a . The concept of a session is generic and applies to most web servers.

How do I share cookies between domains?

Cookies are only accessible to a single domain that they are set to….Then the steps are simple:

  1. add to site A a hidden iframe to site B.
  2. send B’s cookie to A using window. postMessage.
  3. store the received cookie in A’s cookie.

What is difference between application state and session state?

Application state is stored in memory on the server and is faster than storing and retrieving information in a database. Unlike session state, which is specific to a single user session, application state applies to all users and sessions.

How to maintain the same session ID across multiple web applications in?

I mean, If the user lands on domain1.com, set the same session id for domain2.com from iframe. and vice versa. With this, you can maintain same session across multiple domains. You need to test the impact over multiple server over network with load balancer. Is your goal to share the session state between 2 applications, not just the session ID?

How can I share a session between APP1 and APP2?

When you have to make a call to app2 from app1, pass all necessary information via the request object (as a request params) then app2 can read and create the session there (perhaps a servlet/filter can be used for this). you can share a session between the same application (app1 and app1) across machines using clustering.

How is a session tracked in a browser?

Session are generally tracked using an session ID which is generally stored as a cookie on the browser and Session object on the server side. This cookie is sent server side every time when you send a request. A cookie will be sent ONLY to the server where it came from.