I am creating a personal website in which I would like users to register for. I have been looking up various security measures that need to be taken, and am curious as to what the main things I have to pay attention to. I have decided to not use ASP.NET Forms Authentication, primarily for the fun of creating the authentication process myself. Here is what I have done thus far:
- I have a MySQL Database where I am storing the user's login information such as a hash of their password and salt
Upon logging in, set a Session equal to their username -- which brings me to the question: Is this the best way to track a logged in user without using Forms Authentication? For example, setting the session would like something like this:
Session["User"] = username;
Is there a better way to go about tracking logged in users? Or is this an acceptable, yet still secure, way of handling things?
Forms Authenticationat its core is actually very simple, it stores an encrypted cooking with the authenticated users information. This whole process, including what information is stored and how it's stored, can be customized. Using Session state is essentially doing the same thing only the user information is stored on the server. I would really suggest customizingForms Authenticationrather than doing it all from scratch.