0

I'm using Ninject in a ASP MVC-website. I'm looking for a way to store user-data (e.g. username, current group, etc) that is used on multiple places in my website, to prevent multiple database-calls accessing the same data in one request.

My idea is to use a class that is bound using InRequestScope, where I can store the user-data. Is this safe to do? Is there a possibility that the class gets mixed up between multiple users, or is this impossible?

Pbirkoff
  • 4,642
  • 2
  • 20
  • 18

1 Answers1

0

I think you can store these data in session. Also if you use Membership & Roles class of System.Web.Security you can access current user and roles of it by Thread.CurrentPrincipal properties and methods such as Identity and IsInRole(string role)

alisabzevari
  • 8,008
  • 6
  • 43
  • 67