2 Replies Latest reply on Feb 12, 2007 10:54 PM by gavin.king

    Security logout method

    rmemoria

      Is there a way to configure a method of a component to be called when the user logs out or the user's session expires?

      Regards,
      Ricardo Memória

        • 1. Re: Security logout method
          dilator

          For logout, rather than calling identity.logout(), call your own method that either call's Identity.instance().logout(), or calls Seam.invalidateSession() - which at the moment is basically all identity.logout() does.

          For expiring sessions, presumably you already have a session scoped stateful component, i'd annotate a method in it with @Destroy (you'll already have one of these if you're using SFSBs)

          • 2. Re: Security logout method
            gavin.king

            Either

            (a) Add an @Destroy method to any session scope component (you may also need to annotate it as @Startup)

            Or:

            (b) Add an observer to the event org.jboss.seam.preDestroyContext.SESSION