Querystrings and paths are remembered when redirecting after login, but fragments are not so need to handle them too.