Asp.Net Identity - Setting CookieDomain at runtime

前端 未结 3 541
小蘑菇
小蘑菇 2021-01-02 05:41

How can I set the CookieDOmain in the CookieAuthenticationOptions at runtime if i want to pull this value from the Request.Url or from some settings stored in my database?

3条回答
  •  余生分开走
    2021-01-02 06:01

    Do you already try this:

    app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
      AuthenticationType = "Application",
      LoginPath = "/Account/Login",
      CookieDomain = ".myDomain.com"
    });
    

提交回复
热议问题