the ids are autoincrement 1,2,3 … etc.
and the login’s are string
when I do FormsAuth.SignIn( //here should I use the login or the ids
the logins aren’t seen by anybody,
but the ids aren’t hard to guess (for some random person)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on how you do your authentication. The standard generated forms-authentication expects a Username for the user to log in.
So when the user tries to login you should check his username and password against the database. If everything is correct then you can do.
If you wrote your custom membership validation then you can set the AuthCookie to something else like the Id or Email. It just has to be unique.
What you are saying about the Id’s aren’t hard to quess shouldn’t mather. Unauthorized persons shouldn’t be able to do the FormsAuthentication.SetAuthCookie. You always have to check if the pass and username is correct so.
Hope it’s clear enough for you?