I'm working on a legacy website that uses Forms Authentication and was using Classic Managed Pipeline Mode. The default Membership.ApplicationName is read from web.config and can be changed in code to match the application name to allow users to log in on different portals. This works fine in Classic mode, but in Integrated mode the Membership.ApplicationName is null and can't be changed. If it's set to the application name, the value stays at null. Other values are read fine from the web.config
<membership defaultProvider="Database">
<providers>
<add name="Database"
connectionStringName="SkylineMembership"
requiresQuestionAndAnswer="false"
applicationName="/"
type="Eprint.Skyline.Web.Pages.ApplicationProvider"
requiresUniqueEmail="false"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
passwordStrengthRegularExpression=""
maxInvalidPasswordAttempts="99" />
</providers>
</membership>
For example the default value for maxInvalidPasswordAttempts="99" is read OK, but applicationName is always Null, and stays at Null even after being set to another value in code.
The code to set the application name is on a BasePade that is inherited on all the user facing pages. e.g. public partial class Login : BasePage' The website code is using Code Behind, not MVC
Any ideas why I can read and set the Membership.ApplicationName when using Classic mode but not when using Integrated mode? This has got me baffled for a couple of days now.