Ironically my role provider does not cache the roles in a cookie anymore. That was working earlier. Unfortunately i have noticed that only now, so i cannot say what causes the problem. But i think it has to do with the update to the new version 1.2 of the universal providers (released on 16th august).
My config for the roleprovider looks like:
<roleManager enabled="true" cacheRolesInCookie="true" cookieName="X_Roles"
cookiePath="/" cookieProtection="All" cookieRequireSSL="true" cookieSlidingExpiration="true" cookieTimeout="1440"
createPersistentCookie="false" domain="" maxCachedResults="25" defaultProvider="XManager_RoleProvider">
<providers>
<clear/>
<add name="XManager_RoleProvider" type="ManagersX.XManager_RoleProvider, AssemblyX"
connectionStringName="XEntities" applicationName="/" rolesTableName="Roles" roleMembershipsTableName="Users_Roles"/>
</providers>
</roleManager>
Everything is working fine with the rolemanager (loginviews, menu with sitemaptrimming etc.), but it is only not caching the roles anymore. The membership provider, sessionstate etc. are also working fine and the cookies of them are set correctly.
All properties of the static Roles-class are correctly set and everything in Httpcontext (IsSecureConnection etc.) is also correct.
The roles cookie was set earlier, but not anymore. I hope anybody can help me with my problem.
Thanks in advance.
Best Regards,
HeManNew
UPDATE:
Has nobody got the same problem or a tip for me, please?
Below are the details of the Custom Role Provider I wrote that uses proper caching and doesn’t hit the database on each page load.
============= My Code-Behind file ===============
============= End of My Code-Behind file ===============
============= My Web.Config file =======================
============= End of My Web.Config file ================
The cache is set to expire automatically after every 30 minutes. You can modify this as you deem fit.
Cheers.