By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,117 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,117 IT Pros & Developers. It's quick & easy.

Sessions in Custom RoleProviders

P: n/a
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.
Apr 18 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a

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.


"anonymous" <an*******@discussions.microsoft.comwrote in message
news:22**********************************@microsof t.com...
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.

May 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.