Browser back button showing the page from cache?

后端 未结 2 1203
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 06:41

When I logout from wordpress website, it will be redirected to the login page. But the issue is, if I hit the browser back button, It will show the previous page, which need

相关标签:
2条回答
  • 2020-12-09 06:53

    Tried lot of solutions but only the below one worked out . Added below java script in the logout page. All the other solutions will work fine in browsers other than IE.

    window.onunload = function() {
        window.location.href = "<%=request.getContextPath()%>/logout.jsp";
    };
    
    0 讨论(0)
  • 2020-12-09 07:00

    I have tried by setting header like below and it worked like a charm!

    header("Cache-Control: private, must-revalidate,
            max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
          );
    
    0 讨论(0)
提交回复
热议问题