My login
Dim senha = "null"
If Not (senhaLogin.Text = "") Then
senha = senhaLogin.Text
End If
Dim Usuario = GetUsuario.Where(Function(a) a.Email = emailLogin.Text And a.Senha = senha)
If Usuario.Count > 0 Then
Dim userName = Usuario.FirstOrDefault().ID
FormsAuthentication.SetAuthCookie(userName, False)
Response.Redirect("Default.aspx")
End If
My validation that verifies that the user is authenticated
Dim ID = System.Web.HttpContext.Current.User.Identity
If ID.Name = "" Then
Response.Redirect("login.aspx")
End If
My problem is that I always get ID.Name
as null.