How to clear browser cache when user log off in asp.net using c#?

前端 未结 2 1746
清歌不尽
清歌不尽 2021-01-03 03:53

As new in asp.net. In my asp.net application in membership in log off on click event using function ClearSession(), but problem arise

2条回答
  •  臣服心动
    2021-01-03 04:50

    response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
    response.setHeader("Pragma", "no-cache"); 
    response.setDateHeader("Expires", 0); 
    

    These header will only work on pages on which they are included not for all the web application, so either you should add filter which include this header to all pages or you can disable back button.

提交回复
热议问题