Changed how URL fragments are handled when logging in and logging out