I have implemented a custom IPrincipal that I set in
protected void Application_PostAuthenticateRequest(Object sender, EventArgs args)
by doing
Context.User = GetCustomPrincipal(User.Identity);
Thread.CurrentPrincipal = Context.User;
But my custom principal hits the database and gets custom information about the user. I don't want it hitting the database repeatedly for every request.
What is the best way to cache this? I was thinking of storing it in the Session, is that a good idea?
EDIT: Stupid me. Session is not even available in this method, should have tested before posting the question.
But question still remains..