Rolemanager

Discussion in 'ASP .Net' started by JP, Dec 4, 2006.

  1. JP

    JP Guest

    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?
     
    JP, Dec 4, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:newscache$gunr9j$brl$...
    > 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?
    >
    >
    >
    >
    >
    >
     
    Gabriel Lozano-Morán, Dec 4, 2006
    #2
    1. Advertising

  3. For more info see the last paragraph "Caching Role Information":
    http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx

    Gabriel Lozano-Morán

    "JP" <> wrote in message
    news:newscache$gunr9j$brl$...
    > 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?
    >
    >
    >
    >
    >
    >
     
    Gabriel Lozano-Morán, Dec 4, 2006
    #3
  4. JP

    JP Guest

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

    >
    >
     
    JP, Dec 4, 2006
    #4
  5. and does each subsequent call to IsInRole() in a single http request cause a
    database roundtrip?

    Gabriel

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

    >>
    >>

    >
    >
     
    Gabriel Lozano-Morán, Dec 4, 2006
    #5
  6. Also what role provider are you using and have you tried persistant cookies?

    Gabriel

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

    >>
    >>

    >
    >
     
    Gabriel Lozano-Morán, Dec 4, 2006
    #6
  7. JP

    JP Guest

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

    >>
    >>

    >
    >
     
    JP, Dec 5, 2006
    #7
  8. JP

    JP Guest

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

    >>
    >>

    >
    >
     
    JP, Dec 5, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Weaver
    Replies:
    0
    Views:
    758
    Weaver
    Jan 18, 2006
  2. Joel Reinford

    RoleManager & Session object

    Joel Reinford, Jul 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    618
    news.versatel.nl
    Jul 25, 2006
  3. J
    Replies:
    0
    Views:
    1,054
  4. roleManager defaultProvider

    , Dec 21, 2005, in forum: ASP .Net Security
    Replies:
    1
    Views:
    315
  5. MikeS

    roleManager providers

    MikeS, Dec 22, 2005, in forum: ASP .Net Security
    Replies:
    1
    Views:
    109
    MikeS
    Dec 25, 2005
Loading...

Share This Page