Sessions in Custom RoleProviders

G

Guest

I'm working on a Web Application where we control access to our Web Pages by
using Roles. We assign which roles can view which web pages in our
Web.sitemap file. Due the nature of our Application we needed to create our
own Cusomt Role Provider that will go out to the database and get the roles
for the logged on user. As it turns out a User's list of roles can change
while they're browsing through the application. We store information
surrounding the user's new role in a Session variable, but the vast majority
of the time when our Custom RoleProvider is called by the Framework the
Session variables are not avialable. Is there a way to pull this data from
the Session variables, perhaps some way of telling the framework to call our
RoleProvider only after Session variables have been loaded. We have thought
about storing this data in a cookie, but this data is accessed via a Session
all throughout the program, namely SqlDataSources. Changing the data from a
Session to a Cookie would be prohibitive. I appreciate the help. Thank You.
Oh, we're using ASP.NET 2.0 running on IIS 6 in Windows 2003.
 
S

sloan

I'm trying to read thru this:

1. Roles change while a user is logged in.
2. You're using a Custom Role Provider.
3. You store a cached copy of the roles in the Session variable.


Are you storing the values in the Session to help with db hits?
Aka, I can see why you don't want to hit the db every time for a user's
roles.
 

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

Top