I've been learning about the MembershipProvider
class and I thought that the Membership.ValidateUser()
method was supposed to be used to to log a user in.
However, I just learned that there is a FormsAuthentication.Authenticate()
.
What is the purpose of ValidateUser()
within Membership
?
We start by calling the Membership. ValidateUser method, passing in the supplied username and password. If that method returns true, then the user is signed into the site via the FormsAuthentication class's RedirectFromLoginPage method.
Class members, in C#, are the members of a class that represent the data and behavior of a class. Class members are members declared in the class and all those (excluding constructors and destructors) declared in all classes in its inheritance hierarchy.
In short, there are times when you might want to simply validate that a user is who they say they are without needing to persist an authentication cookie for any length of time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With