0

Which part of asp.net mvc is reponsible for the generation of the ReturnUrl. At the moment I am getting this:

?ReturnUrl=%2f

after:

FormsAuthentication.SignOut();

This takes place in a model which is invoked like this:

[HttpGet]
public ActionResult LogOff()
{
    _xModel.LogOff();
    return Redirect("/");
}

changing this to:

[HttpGet]
public ActionResult LogOff()
{
    _xModel.LogOff();
    return RedirectToAction("Index", "Home");
}

does not work.

4

1 回答 1

5

asp.net mvc 的哪一部分负责 ReturnUrl 的生成

没有任何。这根本不是 ASP.NET MVC 的一部分。它是 FormsAuthenticationModule 的一部分,它会为您激活表单身份验证的每个 ASP.NET 应用程序自动注册。为避免这种情况发生,您应该始终在退出用户后重定向:

FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home");
于 2013-02-22T16:12:24.357 回答