Running multiple ASP.net membership sites under the same domain


We have a bunch of seperate microsites hosting book extras content all running in sub domains for a publishers website. Each site is secured is independantly secured with .net membership. A colleague of mine (Richard!) noticed after putting up the second site, that logging into one, also gave access to the other.

The fix was simple; Because cookies are domain-wide, the first auth cookie was being set, and then picked up by all the other sites on that domain. The fix, as detailed in the Microsoft Patterns and Practices Forms Authentication doc, is to just specify a distinct cookie name per application.

Use unique name and path attribute values on the
element as follows.

<forms name="YourAppName"
path="/FormsAuth" ... />

Related posts:

  1. No comments yet.
(will not be published)