1

In my webform application on logout I call

public void Logout()
{
   FormsAuthentication.SignOut();
   HttpContext.Current.Response.SetCookie(new HttpCookie("AUTH") { Expires = DateTime.Now.AddMinutes(-30) });
   HttpContext.Current.Session.Abandon();
   HttpContext.Current.Response.Headers.Add("Clear-Site-Data", "\"*\"");
}

However only the aspx page I logged out from clears from cache, the rest of the aspx pages are still cached. I have below in Global.asax.cs

protected void Application_BeginRequest(object sender, EventArgs e)
{
   Response.Cache.SetCacheability(HttpCacheability.NoCache);
   Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
   Response.AppendHeader("Expires", "0");
}

How do I get all pages clear from cache at logout?

Murometz80
  • 41
  • 5

0 Answers0