How do you deal with the problem where you have user data in session state (HttpContext) and someone changes roles for them in the DB and now your session which is holding a list of roles is out of sync with the change in the DB? You don’t want to hit the DB every time to check roles.
How is this handled?
Use a SqlCacheDependency to monitor a table with the roles. when the table changes, the cache is invalidated. You then query your cache for the roles, not the db.
http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx