Not hitting the database on a authentication request
Posted
Thu, Sep 23 2004 11:37 PM
by
Mischa Kroon
Usually you get the roles that a user belongs to from the database on a Application_AuthenticateRequest which is defined in the global.asax. The following blog post, features a method to only hit the database once:
http://weblogs.asp.net/cazzu/archive/2004/07/21/FormsAuthRoles.aspx
PS. there is a caveat to doing it this way. The cookie size must be under 4k or it wont get saved.