What I am doing is that I do not use ASP.Net authentication. What I do when a user enters their username and password, I check the database if there is a line with the specified username and password.
You can do this using objDataSet.Tables[0].Rows.Count > 0 . You can put this in an if condition, and then take the username and put it in the session. You do it like this:
Session["username"] = (Username Variable Here) . Then you create two master pages: one for pages that are available only for logging in, and accessible for everyone. On the main page, which provides access only to a registered person, you can check whether the session data is zero or not. If it is zero, you can redirect this person to the login page. The LoggedIn master page may remain as it is. If you already have a main page, you can duplicate it and add this condition. If you have not yet implemented the master page, you can place a condition on the page load of each page for which the user must log in to access this page. Since you use sessions rather than cookies, it will be more difficult for the user to hack this system.
source share