You can put following code on get action ,
Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
Response.Cache.SetValidUntilExpires(false);
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
ViewBag.Message = null;
if (Session == null)
{
return RedirectToAction("Index", "Login");
}
else
{
if (Session.Count == 0)
{
return RedirectToAction("Index", "Login");
}
}
}