Prevent user from seeing previously visited secured page after logout

前端 未结 5 1784
陌清茗
陌清茗 2020-11-21 05:59

I have the requirement that the end user should not be able to go back to the restricted page after logout/sign out. But currently the end user is able to do that by the bro

5条回答
  •  眼角桃花
    2020-11-21 06:26

    You can try telling the browser not to cache the homepage (using the appropriate headers - Expires, Cache-Control, Pragma). But it is not guaranteed to work. What you can do, is make an ajax call to the server on page load to check if the user is logged, and if not - redirect.

提交回复
热议问题