링크를 통해 몇 시간을 보냈지 만 뒤로 버튼을 클릭하면 로그 아웃 한 후 내 페이지가 계속로드됩니다. 여기에 내가 시도한 로그 아웃 페이지 코드가있다.뒤로 버튼 로그 아웃 후 문제
protected void Page_Load(object sender, EventArgs e)
{
if(Session[Constants.KeyValues.UserProfileSession]== null)
{
Response.Redirect("www.google.com", true);
}
////Clear cookie and redirect user to login page (Landing page before login).
Response.AddHeader("pragma", "no-cache");
Response.AddHeader("cache-control", "private");
Response.CacheControl = "no-cache";
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
FormsAuthentication.SignOut();
Response.Cookies.Clear();
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
Session.Clear();
Session.Abandon();
Session[Constants.KeyValues.UserProfileSession] = null;
Response.Write("<script type=\"text/javascript\">window.location.replace('www.google.com');</script>");
//Response.Redirect("www.google.com", true);
}
여기 여기 내 html 페이지
<!doctype html>
<html lang="ko">
<head>
<title></title>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<script type="text/javascript">
function ClearHistory() {
var backlen = history.length;
history.go(-backlen);
window.location.href = www.google.com
}
</script>
</head>
<body onload="ClearHistory();">
</body>
</html>
입니다 회원 로그인 후 이동 페이지로드의 코드
protected void Page_Load(object sender, EventArgs e)
{
if(Session[Constants.KeyValues.UserProfileSession]== null)
{
Response.Redirect(SPContext.Current.Site.Url + "/_layouts/ABC/ShoppingLandingBeforeLogin.aspx", true);
} }
여기에 내가 시도 링크가 있습니다.
How to clear browser cache when user log off in asp.net using c#? ,
How to prevent browser and proxy caching of web pages는
Browser back button issue after logout
,Clear History using javascript
, 이것을 사용하는back-button-of-browser-issue-in-asp-net-logout
무엇이 문제입니까? –
변경해야하는 로그 아웃 페이지의 캐시 가능성이 아닙니다. 캐시하려는 페이지의 캐시 가능성입니다. 해당 페이지의 캐싱 헤더는 무엇입니까? –
로그 아웃 후 사용자가 회원 페이지로 리디렉션하지 못하게하고 싶습니다. 뒤로 버튼을 사용 중지 할 수 없지만 브라우저의 캐치를 제거 할 수 있습니다. 또는 내 목표를 달성하기위한 다른 방법. –