Search code examples
asp.net-mvc-3session-state

Storing password in session


I am considering storing user-entered password in session state. Are there any security risks or issues that I need to be aware?


Solution

  • Yes. This is just a really bad idea. You shouldn't even store passwords in a database - best practice is to store hashes of passwords instead. So you can validate the password but if somebody gets access to the database (or session state in your case), they don't actually have the user's password.