Where should you store the credentials?

Posted by: Pdfprep Category: 70-486 Tags: , ,

You are developing an ASP.NET MVC application that uses forms authentication to verify that the user is logged in.

Authentication credentials must be encrypted and secure so no user identity is exposed.

You need to ensure that user credentials are persisted after users log on.

Where should you store the credentials? (Each correct answer presents a complete solution. Choose all that apply.)
A . In Session on the server
B . In a cookie stored in the browser
C . In ViewData in the application
D . In TempData on the server

Answer: A,B

Explanation:

Server sessions and cookies can both be configured to secure and they both persist after the users log on.

Incorrect:

Not C: ViewData’s life only lasts during current http request.

Not D: TempData is a bucket where you can dump data that is only needed for the following request. That is, anything you put into TempData is discarded after the next request completes.

Leave a Reply

Your email address will not be published.