Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-10256

HttpSessionListener is not working

    XMLWordPrintableJSON

Details

    Description

      I am using "HTTP Session Management Module for Tomcat".
      When data managed in a session expires, I want to use HttpSessionListener to handle the deletion of the associated data.
      However, the sessionDestroyed method is not called when the session expires.

      When session expiration is enabled, org.apache.geode.modules.util.SessionCustomExpiry is set in all CacheServers and Clients.
      And when expiration occurs, ExpirationAction.DESTROY is executed.
      DESTROY is executed on all CacheServers and clients at about the same time, and the result of the deletion on the CacheServer is propagated to clients.
      At that time, the operation type of the message sent from the CacheServer to clients is DESTROY.
      SessionExpirationCacheListener is set in the client, but HttpSessionListener#sessionDestroyed will only be executed if Operation.EXPIRE_DESTROY.

      HttpSessionListener#sessionDestroyed is executed if the expiration process is run first on the client side, but HttpSessionListener#sessionDestroyed is executed if the CacheServer's DESTROY event is received first. sessionDestroyed is not executed.

      We should send the EXPIRE_DESTROY event from CacheServer, but I think this has a big impact.
      Therefore, I have introduced a Java system property that delays expiration processing on the CacheServer.
      By setting this, HttpSessionListener#sessionDestroyed will surely be executed by delaying the server-side expiration processing rather than the client's expiration processing.
      Also, if this system property is not set, the behavior will be the same as the current.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              masaki.yamakawa Masaki Yamakawa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: