Asp.net MVC中的登录返回URL问题

Asp.net MVC中的登录返回URL问题,asp.net,asp.net-mvc,forms-authentication,Asp.net,Asp.net Mvc,Forms Authentication,我正在增强web应用程序的安全性。确切地说,会话/成员cookie过期。当我试图在验证之前导航到某个页面时,我注意到了一些奇怪的事情。该页面在登录时工作,当我在登录前尝试转到该页面时,我会被重定向到登录页面Normal,但发送到的位置不正确。它似乎缺少URL中的区域。我想知道这是否与路线有关 以下是更多信息: web.config中的代码: <authentication mode="Forms"> <forms loginUrl="~/logininforma

我正在增强web应用程序的安全性。确切地说,会话/成员cookie过期。当我试图在验证之前导航到某个页面时,我注意到了一些奇怪的事情。该页面在登录时工作,当我在登录前尝试转到该页面时,我会被重定向到登录页面Normal,但发送到的位置不正确。它似乎缺少URL中的区域。我想知道这是否与路线有关

以下是更多信息:

web.config中的代码:

<authentication mode="Forms">
        <forms loginUrl="~/logininformation/loginhomepage" timeout="2880" />
    </authentication>

如果您没有该区域的自定义路由,请在RouteConfig.cs文件中的登录路由下尝试以下操作

routes.MapRoute(
    name: "CustomRoute",
    url: "{area}/{controller}/{action}/{id}",
    defaults: new { controller = "Page", action = "Index",id = UrlParameter.Optional}
);
routes.MapRoute(
    name: "CustomRoute",
    url: "{area}/{controller}/{action}/{id}",
    defaults: new { controller = "Page", action = "Index",id = UrlParameter.Optional}
);