Проблема входа / выхода из системы для нескольких приложений IIS на одном сайте - PullRequest
0 голосов
/ 05 июня 2019

Я развернул такое же приложение, что и два сайта [Производство и разработка] в IIS 8.0 с двумя номерами портов.Проблема заключается в следующем:

Откройте браузер и войдите в первое приложение [Производство];Откройте другую вкладку браузера и войдите во второе приложение [Разработка];Первое приложение автоматически выходит из системы.

Любая идея о том, чтобы и то, и другое нужно было войти в систему и использовать?

Мой файл Startup.Auth.cs:

  app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
  app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);

  // Enable the application to use a cookie to store information for the signed in user
  // and to use a cookie to temporarily store information about a user logging in with a third party login provider
  // Configure the sign in cookie
  app.UseCookieAuthentication(new CookieAuthenticationOptions
  {
    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
    LoginPath = new PathString("/Account/Login"),
    SlidingExpiration = true,
    CookieName="my-very-own-cookie-name",
    //ExpireTimeSpan = TimeSpan.FromMinutes(2.0),
    Provider = new CookieAuthenticationProvider
    {
      // Enables the application to validate the security stamp when the user logs in.
      // This is a security feature which is used when you change a password or add an external login to your account.  
      OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
          validateInterval: TimeSpan.FromHours(applTime),
          regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)),
      OnResponseSignIn = context =>
      {
          context.Properties.AllowRefresh = true;
          context.Properties.ExpiresUtc = DateTimeOffset.UtcNow.AddMinutes(idleTime);
      }

    }
  });
  app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
...