Move redirection out of saveSession