I´m developing a web application on ASP.NET MVC and I´m using ViewBag and TempData to store some values that will live as long until the user logout. I.e: what user is logged in, some internal IDs so I can check roles and another values that the user should not know.
My questions are:
- Is ViewBag / TempData good for this uses? Am I using it right or wrong?
- Are these tools secure?. Can the user sniff this values someway?.
Thanks for your answers.
[Authorize(Roles = "Administrator")].... Your For your query (2): Yes, they are secure... but is not for your purpose of storing something for long duration. For such duration developer mostly useSessionwhich too is secure