Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Rolemanager

Reply
Thread Tools

Rolemanager

 
 
JP
Guest
Posts: n/a
 
      12-04-2006
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?






 
Reply With Quote
 
 
 
 
Gabriel Lozano-Morán
Guest
Posts: n/a
 
      12-04-2006
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

"JP" <(E-Mail Removed)> wrote in message
news:newscache$gunr9j$brl$(E-Mail Removed)...
> 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?
>
>
>
>
>
>



 
Reply With Quote
 
 
 
 
Gabriel Lozano-Morán
Guest
Posts: n/a
 
      12-04-2006
For more info see the last paragraph "Caching Role Information":
http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx

Gabriel Lozano-Morán

"JP" <(E-Mail Removed)> wrote in message
news:newscache$gunr9j$brl$(E-Mail Removed)...
> 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?
>
>
>
>
>
>



 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      12-04-2006
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

"Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
news:OQXiwc%(E-Mail Removed)...
> For more info see the last paragraph "Caching Role Information":
> http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx
>
> Gabriel Lozano-Morán
>
> "JP" <(E-Mail Removed)> wrote in message
> news:newscache$gunr9j$brl$(E-Mail Removed)...
>> 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?
>>
>>
>>
>>
>>
>>

>
>



 
Reply With Quote
 
Gabriel Lozano-Morán
Guest
Posts: n/a
 
      12-04-2006
and does each subsequent call to IsInRole() in a single http request cause a
database roundtrip?

Gabriel

"JP" <(E-Mail Removed)> wrote in message
news:newscache$cbrr9j$9mo$(E-Mail Removed)...
> 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
>
> "Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
> news:OQXiwc%(E-Mail Removed)...
>> For more info see the last paragraph "Caching Role Information":
>> http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx
>>
>> Gabriel Lozano-Morán
>>
>> "JP" <(E-Mail Removed)> wrote in message
>> news:newscache$gunr9j$brl$(E-Mail Removed)...
>>> 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?
>>>
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Gabriel Lozano-Morán
Guest
Posts: n/a
 
      12-04-2006
Also what role provider are you using and have you tried persistant cookies?

Gabriel

"JP" <(E-Mail Removed)> wrote in message
news:newscache$cbrr9j$9mo$(E-Mail Removed)...
> 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
>
> "Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
> news:OQXiwc%(E-Mail Removed)...
>> For more info see the last paragraph "Caching Role Information":
>> http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx
>>
>> Gabriel Lozano-Morán
>>
>> "JP" <(E-Mail Removed)> wrote in message
>> news:newscache$gunr9j$brl$(E-Mail Removed)...
>>> 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?
>>>
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      12-05-2006
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

"Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
news:uaINOD$(E-Mail Removed)...
> Also what role provider are you using and have you tried persistant
> cookies?
>
> Gabriel
>
> "JP" <(E-Mail Removed)> wrote in message
> news:newscache$cbrr9j$9mo$(E-Mail Removed)...
>> 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
>>
>> "Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
>> news:OQXiwc%(E-Mail Removed)...
>>> For more info see the last paragraph "Caching Role Information":
>>> http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx
>>>
>>> Gabriel Lozano-Morán
>>>
>>> "JP" <(E-Mail Removed)> wrote in message
>>> news:newscache$gunr9j$brl$(E-Mail Removed)...
>>>> 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?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      12-05-2006
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?

"Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
news:OjZ1m%23%(E-Mail Removed)...
> and does each subsequent call to IsInRole() in a single http request cause
> a database roundtrip?
>
> Gabriel
>
> "JP" <(E-Mail Removed)> wrote in message
> news:newscache$cbrr9j$9mo$(E-Mail Removed)...
>> 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
>>
>> "Gabriel Lozano-Morán" <(E-Mail Removed)> wrote in message
>> news:OQXiwc%(E-Mail Removed)...
>>> For more info see the last paragraph "Caching Role Information":
>>> http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx
>>>
>>> Gabriel Lozano-Morán
>>>
>>> "JP" <(E-Mail Removed)> wrote in message
>>> news:newscache$gunr9j$brl$(E-Mail Removed)...
>>>> 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?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RoleManager, Role Provider and Caching of Roles. J ASP .Net 0 05-01-2007 05:08 PM
RoleManager & Session object Joel Reinford ASP .Net 1 07-25-2006 02:04 PM
Invalidate cache of AuthorizationStoreRoleProvider in ASP.NET 2.0 RoleManager Weaver ASP .Net 0 01-18-2006 02:19 PM
roleManager providers MikeS ASP .Net Security 1 12-25-2005 04:03 PM
roleManager defaultProvider michael.spencer@gmail.com ASP .Net Security 1 12-21-2005 05:48 AM



Advertisments