3 Replies Latest reply on Jun 10, 2008 11:45 AM by nickarls

    Share session between multiple clients(browsers)

    erimag

      I'm not sure this has anything specifically to do with Seam, but I'm hoping there might be a neat way of accomplishing this with Seam.


      What I'm interested in doing is sharing session-scoped information between multiple clients/browsers logged in as the same user.


      An example of what I would like to accomplish:


      - User A logs in using Firefox.
      - User A executes an order in the system, which is stored in a session scoped bean.
      - User A opens Internet Explorer and (once again) logs in to the system (since IE has no idea that there is a valid session in Firefox).
      - User A lists his current orders in IE, and should see the order he just executed using Firefox.
      - User A cancels the order in IE.
      - User A switches back to Firefox, lists his orders, and the order should be cancelled.


      Is there any way of accomplishing this without persisting the order information immediately?

        • 1. Re: Share session between multiple clients(browsers)
          nickarls

          I don't think there is any natural way of doing that(?) but you could always use the application scope to store stuff e.g. in a Map with the user id as key...

          • 2. Re: Share session between multiple clients(browsers)
            erimag

            That is of course an acceptable solution if there was only one or a few specific usecases. I guess the issue is that we would like our application to have this behaviour for all session-scoped data. It should just work.


            In essence, a new scope type USER or IDENTITY would be ideal. I'm thinking of formulating a request for such a feature.


            But in the meantime, perhaps there is someway of tricking the application or server into using the same HttpSession for both clients/browsers as long as the same identity is established?

            • 3. Re: Share session between multiple clients(browsers)
              nickarls

              Perhaps you could extend BasicContext and override stuff from Context to take the identity in account.


              But yes, I see the usecase for custom scopes like that, haven't looked if there are JIRAs for it.