Rolemanager

  • Thread starter Thread starter JP
  • Start date Start date
J

JP

Hi folks
I have the following settings for my Rolemanager
roleManager enabled="true" cacheRolesInCookie="true" cookieTimeout="30"
cookieSlidingExpiration="true" cookieName=".ASPXROLES"

My Expectation was that any hit to the database after the initial load
should be after 30 minutes for a session , however I have found that this is
not the case and every time I do Roles.IsUserInRole in the UI, the
database Stored Proc is being called.( I was running a trace)

Can anybody throw some light on this?
 
Since role information for each user is stored in a cookie on the client,
this propably means that the clients browser does not support cookies.

Gabriel Lozano-Morán
 
Hi Gabriel
The browser does accept cookies. I have confirmed this. It has Firt Party
cookies to Accept and Third Party cookies to accept

Thanks
 
and does each subsequent call to IsInRole() in a single http request cause a
database roundtrip?

Gabriel
 
Also what role provider are you using and have you tried persistant cookies?

Gabriel
 
Hi Gabriel,
I did change the cookies to persistent and the role provider I use is the
SQL Role Provider. I have a bunch of AJAX so with constant refreshes, this
behavior impacts performance .

Thanks
 
Well , per the documentation
"If a user's browser allows cookies, ASP.NET can optionally store role
information in an encrypted cookie on the user's computer. On each page
request, ASP.NET reads the cookie and populates the role information for
that user from the cookie."

Shouldn't this cached information be used across requests?
 
Back
Top