Level 58
You can use the beforeunload event to clear the session messages when the user navigates away from the page. This event is triggered when the user leaves the page, so you can use it to clear the session messages.
window.addEventListener('beforeunload', function(e) {
sessionStorage.removeItem('toastr');
});