Added onSessionEnd so that clients can cleanup stuff before session is gone.