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

Posted by Ralph Shillington on Stack Overflow See other posts from Stack Overflow or by Ralph Shillington
Published on 2009-05-07T17:37:58Z Indexed on 2010/03/23 22:03 UTC
Read the original article Hit count: 434

Filed under:
|

In my web.config I have the Role Manager configured as follows:

<roleManager enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" 
cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" 
cookieSlidingExpiration="true" cookieProtection="All">

however in our custom RoleProvider it would seems that the GetRolesForUser method is always being called, rather than as I would have expected, the RoleManager serving up the roles from its cookie.

We're using something like to get the roles for a user:

string[] myroles = Role.GetRolesForUser("myuser");

Is there something that I'm missing in the configuration, or in the use of the RoleManager

Thanks in advance

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about roleprovider