Membership ApplicationName

Discussion in 'ASP General' started by ePrint, Nov 26, 2007.

  1. ePrint

    ePrint Guest

    Asp.Net v2.0
    I have created a web application and I am using it from a single website and
    database. The web application has different ‘portals’ – each independent and
    I am using the Membership & Roles ApplicationName to separate out my
    different groups of users within the membership database.

    I had been having problems with ‘random’ bugs - as though my Membership
    database was 'sharing' information between users and applications rather than
    keeping it separate.

    I have now come across this article. Is what it is saying about Membership
    being a singleton true?

    The Membership and Role classes use the singleton design pattern. I did not
    instantiate either one in my code to access their ApplicationName properties,
    I just used the instance that is automatically created for me. All
    applications running on the same web server share the same instances of these
    classes, and when one application changes a property, all applications are
    affected. How can different applications use separate roles and users without
    stepping on each other then?

    If your applications are big enough to each have their own web server - or
    web farm - there is no problem. You can set the application names in
    machine.config and not worry about it. They can share a centralized
    membership services database without interfering with each other. You could
    set up separate databases to support membership services for each
    application, at the loss of some centralization. You could also just use the
    stored procedures directly, rather than accessing them through the Membership
    and Role methods. This approach lets you set the application name directly,
    without reference to the properties.
    ePrint, Nov 26, 2007
    1. Advertisements

  2. ePrint wrote:
    > Asp.Net v2.0

    There was no way for you to know it (except maybe by browsing through
    some of the previous questions before posting yours - always a
    recommended practice), but this is a classic asp newsgroup. ASP.Net is
    a different technology from classic ASP. While you may be lucky enough
    to find a dotnet-savvy person here who can answer your question, you
    can eliminate the luck factor by posting your question to a newsgroup
    where the dotnet-savvy people hang out. I suggest
    There are also forums at where you can find a lot of people
    to help you.

    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Nov 26, 2007
    1. Advertisements

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. Francis Reed
    Erik Funkenbusch
    Apr 8, 2006
  2. ePrint

    Membership & Roles ApplicationName

    ePrint, Nov 28, 2007, in forum: ASP .Net
    Nov 29, 2007
  3. Thomas
    Juan T. Llibre
    Aug 16, 2008
  4. MrGrundh

    Membership.ApplicationName and thread safety.

    MrGrundh, Aug 30, 2006, in forum: ASP .Net Security
    Mar 30, 2007
  5. ePrint

    Membership & Roles ApplicationName

    ePrint, Nov 27, 2007, in forum: ASP .Net Security
    Nov 27, 2007

Share This Page