1

we are using ASP.Net MVC with the Asp.Net Identity.

We have around 100 user informations we save in the database with the identity model.

What I want is to save temporary information the identity. The Information is HOW the user is logged in right now (SMS code, password, email code etc.etc. we have a bunch of types to log in). So that is not a database information, it is a simple temporary information as long as the auth cookie exists.

How to add this?

Rene Koch
  • 317
  • 3
  • 13

1 Answers1

0

I would just add a new cookie that has that information. Something like this:

Response.Cookies["AdditionalInfo"]["LoginMethod"] = "SMS";

You can find more info here.

Be very careful how you use the information that is in there. A malicious user could modify the values in there to be whatever they want - so if you are using cookie values for security purposes you will get hacked.

You could also look at storing that info in the view state or the session state.

Abe Miessler
  • 82,532
  • 99
  • 305
  • 486