4 Replies Latest reply on Jan 25, 2008 8:00 AM by nickarls

    Closing User Session

    gregtk

      Hi, all! Please explain me how I can close User session when I remove user from database. Which method I need to call before I delete user from database?

        • 1. Re: Closing User Session
          nickarls

          I don't think you can forcefully end another users session.

          You probably have to flag/signal the termination in some application scoped component and then have the client poll that place and have the client self-destruct...

          • 2. Re: Closing User Session
            gregtk

            Maybe you can write some example?

            • 3. Re: Closing User Session
              nickarls

              Dont be lazy ;-)

              * Write an application scoped bean with a Set that contains something identifying the user (session, user id etc).
              *Add a method that queues the id for destruction.
              *Add a boolean method that checks if the set contains() id.
              *Add a page action that uses the boolean method and logs out if it returns true.
              *Add cleanup.

              As I said, there might be better ways.

              • 4. Re: Closing User Session
                nickarls

                Of course polling against JMS or some sort of push (depending on view technology) might be cleaner.