Friday 13 May 2016

Preventing Page Review after Logout with Forms Authentication: ASP.Net MVC

 //put this function within Global.asax.cs
//every click of back button it will reload. So you can each control check session is available or not
//based on session value redirect the page
protected void Application_BeginRequest()
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
            Response.Cache.SetNoStore();
        }

No comments:

Post a Comment