code: public void valueUnbound( HttpSessionBindingEvent event )
      {
          //
          // We may have lost our transient ServletContext reference.  Try to get the ServletContext reference from the
          // HttpSession object if necessary.
          //
          ServletContext servletContext = getServletContext();
          HttpSession session = event.getSession();
  
          if ( servletContext == null && session != null )
          {
              servletContext = session.getServletContext();
          }
  
          if ( servletContext != null )
          {
              if ( !_isDestroyed && Handlers.get( servletContext ).getStorageHandler().allowBindingEvent( event ) )
              {
                  destroy( session );
                  _isDestroyed = true;
              }
          }
      }
docs: Callback when this object is removed from the user session.  Causes {@link #onDestroy} to be called.  This is a
  framework-invoked method that should not be called directly.