Does the asp.net RoleManager really cache the roles for a user in a cookie if so configured?

。_饼干妹妹 提交于 2019-12-04 13:58:24

You are missing defaultProvider="yourRoleProviderName" in your web.config .

Do you call the method below for any user or for current user only? Cookie caching works only for current user roles.

Role.GetRolesForUser("myuser");

Check that .ASPROLES cookie is sent to browser after the fist call of IsInRole or GetRoles method.

It might work better if you were to change the value in your cacheRolesInCookie to true.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!