注销后点击浏览器后退按钮重定向到asp.net mvc中的上一页 [英] After logout while clicking on browser back button redirecting to the previous page in asp.net mvc

查看:75
本文介绍了注销后点击浏览器后退按钮重定向到asp.net mvc中的上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注销后点击浏览器后退按钮,重定向到asp.net mvc.how中的上一页,单独使用,我的代码在下面

After logout while clicking on browser back button redirecting to the previous page in asp.net mvc.how to sole it and my code is below

[AllowAnonymous]
     public ActionResult LogOff()
     {
             FormsAuthentication.SignOut();
             Session.Abandon();
             Session.Clear();
             Session.RemoveAll();





}





}

public ActionResult Index()
{
        return View();
}

What I have tried:

i have tried by using this code it's not working?
   protected void Application_BeginRequest()
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
            Response.Cache.SetNoStore();
        }

推荐答案

所有操作都应使用属性[授权]进行修饰,或者您可以在全局级别进行操作。



谷歌[授权]在全球MVC你会找到足够的信息
All actions should be decorated with attribute [Authorize] or you could do it global level.

Google [Authorize] at global in MVC you will find enough information


这篇关于注销后点击浏览器后退按钮重定向到asp.net mvc中的上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆