[英]How to Prevent Authentication when User Press Back button after signout in MVC Razor?
[英]why it goes to a page when signout and press browser back button in c#, mvc
我在c#,mvc中创建登录名。 它工作正常。 退出也可以正常工作。 但是,在用户注销后,如果用户按“后退”按钮,则会转到登录成功后重定向到的页面。 我尝试将其添加到global.asax.cs
。 但这没用。 而且我尝试使用javascript。 那时,如果用户按返回按钮,它将显示该页面并消失。 我该怎么办?
这就是我尝试使用C#的方式
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
protected void Application_BeginRequest()
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddMilliseconds(-10));
Response.Cache.SetNoStore();
}
请在这件事上给予我帮助
您无法清除用户历史记录,但是可以从成功登录后重定向用户的页面中添加未授权用户的重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.