2 Replies Latest reply on Jun 25, 2018 2:55 AM by Bernhard Kabelka

    HttpSessionListener for sessions shared across different WARs in a single EAR

    Bernhard Kabelka Newbie

      Hi,

       

      I have an EAR containing two WARs with enabled session sharing across the WARs. Basically, one WAR contains the web UI, and the other WAR contains the REST interfaces for AJAX calls made by the UI.

       

      The session sharing itself works fine. However, I have an issue with an HttpSessionListener listening for session creation and destruction: The user authenticates against the UI-WAR. On logout, a REST method in the AJAX-WAR is triggered which calls HttpSession.invalidate() on the user session.

       

      In WildFly 8.2.0, a HttpSessionListener in the UI-WAR gets notified immediately about session creation and destruction.

       

      In WildFly 13.0.0, however, a HttpSessionListener in either WAR only gets one of the two notifications:

      • In the UI-WAR, I get a notification about the created session immediately when the login form is loaded. However, I do not receive any notification about the session destruction (unless it times out).
      • In the AJAX-WAR, I do not get any notification about the session creation at all, but I immediately receive a notification about the session destruction.

       

      Was this behaviour changed intentionally? Is there any way to receive both notifications in a single listener also in WildFly 13, or do I have to put one listener in each of the two WARs?