Gurus Thoughts Please!!!

G

Guest

Hi all,

I am writing an application in .net 2.0.
Normally, in my previous projects i have always carried
certain information about authenticated users around in Session variables.
IE: AccountID, UserRoleID & EmailAddress.

Now with 2.0 i know there are a few new classes available that are designed
to handle this kind of info. So in my app, I have created a custom
membership & role provider.
This allows me to determine what role a user is currently logged in under &
to perform
basic authentication and the like.

However, out of the box, these providers may not provide a particular bit of
information
about a user i am after. IE: I believe using the Membership Api i can
retrieve a users
username, password ect...but no their associated 'ID'. (This is probably
wrong)

So my question is, with the number of new options available where should i
provide access to these
info.

1) Should i create my own MembershipProvider.GetUserAccountID method.
2) Or simply store this id in a session variable once a user logs in...
this has been the standard way of mananging this information until now.
3) Is this somewhere the profile class would come in....

At this stage, i am not looking for anything terribly robust...as the
information i
require is very little, and mostly to do with my web apps administration.

With a number of options available, i am just after what you guys are doing...
What your thoughts on how to proceed are ?
Or to clear up any ignorance!!!

Cheers,
Adam
 
C

Cowboy \(Gregory A. Beamer\)

If you are going the provider route, the best option is to extend the
providers to include what you need. You can then use the custom providers as
if they were MS providers, but they will hold the additional information.

If you are going to throw things into session, why use the providers at all?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 

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