반응형
특정 페이지에서 로그아웃 후 다시 뒤로가기를 하면 해당 페이지가 다시 보여지는 문제를 해결해보자
원인 |
캐시가 남아 있어서 그럴 것으로 판단됐다.
구글에 검색하여 가장 많이 나오는 meta태그를 이용하는 방법을 써보았으나 해결되지 않았다.
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Pragma" content="no-store">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
해결 |
Global.ascx의 시작 함수에 다음 코드를 적용
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
반응형
'프로그래밍 > .NET' 카테고리의 다른 글
[.NET] App_Code 폴더 클래스 (CS 파일) 참조하지 못할 때 (0) | 2019.06.18 |
---|---|
[ASP.NET] web.config 세션 시간 초과 설정 (0) | 2018.04.25 |
[ASP.NET] HTML 코드를 원본 상태로 출력 (@Html.Raw) (0) | 2017.10.12 |
[ASP.NET] 유효성 충돌 방지 (ViewState MAC에 대한 유효성 검사가 실패했습니다.) (0) | 2017.02.03 |
[ASP.NET] DropDownList ListItem 선택 시 이벤트 발생 (0) | 2017.02.03 |