Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  




           


Reduce calls to GetRolesForUser
A .NET 4.0 RoleProvider was calling GetRolesForUser all the time - any time you checked IsUserInRole.
This was resulting in tons of calls to the database to retrieve this data.

To resolve this, add cacheRolesInCookie="true" to the roleManager tag in your web.config file.

Note, you should only do this if you have a small number of roles (< 100) or your cookie will be too large and break the application.

<roleManager enabled="true" defaultProvider="MyRoleProvider" cacheRolesInCookie="true">
<providers>
etc...

Created By: amos 3/19/2013 5:24:44 PM
Updated: 3/19/2013 5:25:51 PM