Hi Jürgen,
The behavior for session destruction notification matches the
behavior defined by the Servlet spec and its HttpSessionListener
interface. The behavior is to notify session destroy listeners
after all attributes have been unbound from the session and the
session have been invalidated. My opinion is that the destory
listener hook as spec'ed isn't very useful (I'd have voted for
pre/post hooks).
If you want to do something on session shutdown, the safer
approach is to create an instance of a class that implements the
FlexSessionBindingListener interface on session creation and add it
as an attribute on the new session. As long as no code removes this
attribute from the session arbitrarily, when the session is
destroyed this attribute will be unbound and its valueUnbound()
callback will be invoked. You shouldn't base your logic in
valueUnbound() on having access to attributes in the session,
because other attributes may be unbound by the time your listener
is unbound.
Best,
Seth