Flush react/output onSessionEnd

Closes #361