ASP.NET MVC Custom Role Provider/RolePrincipal
Posted
by Keith K
on Stack Overflow
See other posts from Stack Overflow
or by Keith K
Published on 2010-03-24T00:00:07Z
Indexed on
2010/03/24
0:03 UTC
Read the original article
Hit count: 1114
My asp.net MVC application is not caching roles instead it round tripping to the database every request. Also when I attempted to view the cookie I noticed it had not been written to the browser.
Web.config:
<roleManager defaultProvider="CustomRole" enabled="true" cacheRolesInCookie="true" cookiePath="/" cookieName="CustomRole" maxCachedResults="25" cookieSlidingExpiration="true" cookieProtection="All" cookieRequireSSL="false" createPersistentCookie="false">
<providers>
<clear/>
<add name="CustomRole" type="Membership.CustomRole, Membership" connectionString="MemberDB" applicationName="/"/>
</providers>
</roleManager>
© Stack Overflow or respective owner