Add option sessionOnClose for user-specific callback on session termination