Rolemanager

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?
 
G

Gabriel Lozano-Morán

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
 
J

JP

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
 
G

Gabriel Lozano-Morán

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

Gabriel
 
G

Gabriel Lozano-Morán

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

Gabriel
 
J

JP

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
 
J

JP

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top