2 Replies Latest reply on Sep 16, 2013 8:16 AM by abhijithtn

    How to manage session in different WAR inside single EAR in jboss?

    nthananjayan

      How to maintain session in different WAR inside single EAR in jboss? I have searched in google but i could not get correct solution, whether we can manage the session in different war or not.?

        • 1. Re: How to manage session in different WAR inside single EAR in jboss?
          luan.cestari

          I think you could use Infinispan as a inmemory key-value to hold the sessions you want to share between different Web Contexts. Other ways that I think it also possible with JBoss 7 / Java EE 6 is using EJB Singleton to hold a Map with the Key is a reference of the user session and the value is the shareable object. I think the CDI Application scope could also work.

          • 2. Re: How to manage session in different WAR inside single EAR in jboss?
            abhijithtn

            I feel this as more of a design issue. Unless, the first application is providing a SSO, there is no need to transfer the session to the second application. There will be a security threat as well.

             

            If modularization is the reason, JSF provides a way to package related pages and its managed beans separately in jar file and include this jar file as dependency in war.

             

            Though Luan suggestion might work, I personally not in favour of that solution.

             

            Let us know if you find out a solution for this.