Logout issue with browser back button

前端 未结 3 868
难免孤独
难免孤独 2021-01-16 11:30

I have created Login/ Logout functionality using ASP.Net MVC 4. I used my own created form for authenticate users against Active Directory. It is working fine with the funct

3条回答
  •  遥遥无期
    2021-01-16 12:10

    add the following code in your global.asax page and remove first 3 lines from your logout() function.

    protected void Application_BeginRequest()
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
        Response.Cache.SetNoStore();
    }
    

提交回复
热议问题