I have a problem when user logout and hit the back button of the browser the pages are showing from browser history
my need is after logout if user clicks on back button it doesnot go previcious pages how to do this MVC my code pasted here
public ActionResult LogOut()
{
UserInformation user = null;
if (Session["LoginUser"] != null)
{
user = (UserInformation)Session["LoginUser"];
user.IsLoggedIn = false;
Services1 s1 = new Services1();
string result = s1.UpdateLoginStatus(user);
}
//Deleting user directory in server
string tempDir = "C:\\InndocsiHealth\\PDFFiles\\" + user.UserId;
string[] files = null;
if (Directory.Exists(tempDir))
{
files = Directory.GetFiles(tempDir);
foreach (string file in files)
{
if (System.IO.File.Exists(file))
{
System.IO.File.Delete(file);
}
}
Directory.Delete(tempDir, true);
}
Session.Clear();
Session.Abandon();
Session.RemoveAll();
return RedirectToActionPermanent("Home", "Home", new { area = "" });
}