Any Way to Share Session State Between Different Applications in Tomcat

Any way to share session state between different applications in tomcat?

You should not share HttpSession; but you can share other objects. For example, you can register an object via JNDI and access the same object in all your apps (databases use this to pool connections).

How to share session across two web applications deployed in two different tomcat instances

You can use a token parameter, where the token could be the username/some credentials encrypted. You can verify the credentials are correct in the 2 apps.

An alternative, if your applications are under the same domain would be set cookies and recreate the session from them.

Sessions Sharing between two web applications : tomcat

You can find documentation for Tomcat clustered sessions here.

Tomcat: How to share data between two applications?

Just put the data in a file on the disk file system or a database server which both have access to.


Update: as per the update and the comments, the functional requirement seems to boil down to let the webapps on the same server share the same HttpSession (including all of its attributes). In that case, you need to set the emptySessionPath attribute of the <Connector> element in Tomcat's /conf/server.xml to true.

<Connector emptySessionPath="true">

Keeping JSP session alive between two applications on two tomcat servers

I think you might want a SSO (Single Sign-On) solution. So here are these which are available for free and some open source:

  1. Open AM (previously Open SSO)
  2. JOSSO (Java open Single Sign-On)
  3. CAS (Central Authentication Service)

You can also build some custom security in both these web-applications using Servlet filters following the approach as mentioned here.

Note: Go for the custom solution (it would be a pain but a good learning ;-)) only if you don't want to use any of the SSO solutions; I will suggest not to Reinvent-the-wheel due to the reasons given here)

Hope this helps.

Distributed HTTP session state server for tomcat

I developed session state server for tomcat using python.

Due to this I don't need to change the code already written for creating/accessing and destroying session. Also as there is separate server/service which is handling and storing session so not master cluster is needed.



Related Topics



Leave a reply



Submit