2017-11-29 4 views
0

asp.net mvcでWebアプリケーションを開発しています。Asp.Net Mvc「Remember Me」がサーバで動作していない

ローカルでは動作するようですが、共有ホスティングでは、約10分間ログアウトしてからログアウトします。ここで

コードです:

AccountController.cs 

       var claims = new List<Claim>(); 

       claims.Add(new Claim(ClaimTypes.NameIdentifier, user.Id.ToString())); 

       var identity = new ClaimsIdentity(claims, DefaultAuthenticationTypes.ApplicationCookie); 

       var context = Request.GetOwinContext(); 

       var authenticationManager = context.Authentication; 

       authenticationManager.SignIn(new AuthenticationProperties { ExpiresUtc = DateTime.UtcNow.AddDays(90), IsPersistent = true }, identity); 

       return RedirectToAction("Index", "Dashboard"); 

Startup.cs

public void ConfigureAuth(IAppBuilder app) 
    { 
     app.UseCookieAuthentication(new CookieAuthenticationOptions 
     { 
      AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, 
      CookieName = "social", 
      CookieSecure = CookieSecureOption.Never 
     }); 
    } 

答えて

0

マシンキーを追加することによって、私の問題を解決する、希望は誰か

に役立ちます
関連する問題