简体   繁体   中英

asp.net membership for two projects in a solution

I have two web projects both using the same database and they are in the same solution. One of them using asp.net membership.I want also include the other one.How can I manage this?

Configure the second app to use the same membership database. Change the applicationName property of the membership provider config in your web.config to something different from the first app.

I've done this for nested applications recently. Its not too difficult.

In addition to Kyle's points, you need to:

  • make sure the the machineKeys are the same for both web applications
  • configure loginUrl's to resolve to the same absolute path
  • if you're using cookies you need to make sure that the domain is set to a value available to both web applications
  • also for cookies, if your web applications are nested at diferent levels in a domain make sure that the path attribute is set to "/"

See this blog post for more detail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM