Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-6133

Allow modules to listen for http session events

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • Core 2.6.0, Core 2.5.6
    • None
    • None
    • Low

    Description

      The servlet API has a notion of an HttpSessionEvent and listeners that can receive notifications of sessionCreated and sessionDestroyed events. One can register a Listener via web.xml that implements the HttpSessionListener interface in order to be notified of such events and incorporate them into your application as appropriate.

      Because this is configured via a registered Listener in web.xml, it would be potentially useful to add an enhancement to the existing OpenMRS "Listener" class that is already registered, to extend it to implement this interface, and implement this interface by broadcasting sessionCreated and sessionDestroyed events to any registered Components that implement this interface.

      This will ultimately allow any module to add an HttpSessionListener implementation, annotated as a @Component, and receive HttpSessionEvent notifications.

      My current interest in this is adding additional logging and auditing around user logins, and having the ability to monitor HttpSession create/destroy events will allow detecting when users are logging out vs. having their sessions timeout, etc.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                mseaton Mike Seaton
                mseaton Mike Seaton
                Daniel Kayiwa Daniel Kayiwa
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: