Vb.net 登录后未填充HttpContext.Current.User.Identity

Vb.net 登录后未填充HttpContext.Current.User.Identity,vb.net,asp.net-identity,Vb.net,Asp.net Identity,因此,我正在使用AspNet Identity,并尝试在登录后访问Http.Context.Current.User中的用户会话变量。我在网上读到,一旦登录成功,它应该自动填充。然而,这似乎不是我的情况 这是我的代码: Dim email As String = txtEmail.Text Dim password As String = txtPassword.Text Dim user As ApplicationUser

因此,我正在使用AspNet Identity,并尝试在登录后访问
Http.Context.Current.User
中的用户会话变量。我在网上读到,一旦登录成功,它应该自动填充。然而,这似乎不是我的情况

这是我的代码:

  Dim email As String = txtEmail.Text
            Dim password As String = txtPassword.Text
            Dim user As ApplicationUser

            If Session("LocalNetwork") Then
                Await _signInManager.PasswordSignInAsync(email, password, False, False))

                Dim y = HttpContext.Current.User.Identity.GetUserId

            End If
登录成功,我正在尝试访问我的UsersID,但它返回null

Web配置:

<authentication mode="None" />


有人知道为什么吗?

这是因为我在更新用户时检查用户是否在同一请求中进行了身份验证。因此,在请求结束之前,它们不会被验证。

请查看:谢谢您的回复,但我认为这不是我的问题。不,这不完全是您的问题,但您可以找到它。。。。