0

AccountController でのログオン アクション

                // Logon Logic.

                FormsAuthentication.SetAuthCookie(model.UserInfo, model.RememberMe);

                if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
                    && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                {
                    return Redirect(returnUrl);
                }
                else
                {
                    return RedirectToAction("Index", "Home");
                }

Web.Config


<authentication mode="Forms">
  <forms name="TestRadarManager" loginUrl="~/Account/LogOn" timeout="2880" slidingExpiration="false" />
</authentication>

HomeIndex.cshtml


@if (Request.IsAuthenticated)
                {
                    <span>Welcome,</span><b>@Context.User.Identity.Name</b>
                }

FF ブラウザーでは問題なく動作しますが、IE では Request.IsAuthenticated は常に false です。

4

0 に答える 0