ASP.NET ApplicationId
Asked Answered
L

1

7

I've read somewhere that ApplicationID is a unique id for a website (IIS site path). But I'm still confused.

  • When and why do I need this?
  • I'm trying to implement asp.net membership for a website and I'll create some additional SQL tables (such as Companies, Services, etc) other than asp.net membership tables. So; do I need to include an ApplicationID column to these custom tables? Why?
Longspur answered 21/7, 2010 at 23:3 Comment(0)
J
4

The application ID is stored in a the aspnet_Applications table in your membership database. When you first enable the ASP Memebership provider, the application name that you set in your web.config is entered into this table. From then on, the membership provider uses your application name to determine which users can login for user authentication in your app.

To answer your second question, no, unless you have a unique need/requirement to do so. Reason: The asp.net membership is setup so that you can host multiple possibly distinct applications using one membership database. This is nice in that you do not have to create a different database for each one of your sites for authentication. Unless you will have multiple/distinct applications hitting these other tables that you have mentioned, you do not need to worry about assigning the appID to them as your users are already logged in.

Jairia answered 22/7, 2010 at 0:12 Comment(3)
Thanks for the answer but I still have a few questions. When you say "you can host multiple possibly distinct applications using one membership database" do you mean something like. www.stackoverflow.com and www.superuser.com could use the same membership database? Thanks.Farriery
absolutely. Since the AppID can be set to be unique to each application, you could have a [email protected] APPID - SiteA and a [email protected] APPID - SiteB without a user name already taken error.Jairia
if you need to share login information between the two sites, you could a) make the APPIDs the same or b) customize the membership provider to be able to copy information from users within one APPID to another, though I would caution this approach as it could open up some security holes.Jairia

© 2022 - 2024 — McMap. All rights reserved.