fix url redirection at the end of session