I am trying to use forms authentication with the following configuration settings. I set cacheRolesInCookie to true. However, I find that the RoleProvider GetRolesForUser method is called for each request. I see that cookie.asproles is created and contains data in it, but it seems to be ignored.
Has anyone encountered this problem before? Any help would be greatly appreciated.
<authentication mode="Forms"> <forms name=".formsauth" loginUrl="~/Login.aspx" defaultUrl="~/Home.aspx" slidingExpiration="true" timeout="20" path="/" /> </authentication> <membership defaultProvider="CustomMembersipProvider"> <providers> <add name="CustomMembersipProvider" type="Company.Membership.CustomMembersipProvider" /> </providers> </membership> <roleManager defaultProvider="CustomMembershipRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".asproles" cookieTimeout="20" cookieSlidingExpiration="true" cookieProtection="All" createPersistentCookie="true"> <providers> <add name="CustomMembershipRoleProvider" type="Company.Membership.Provider.CustomMembershipRoleProvider" /> </providers> </roleManager>
Thanks a lot Naren
source share