Prevent user from seeing previously visited secured page after logout

前端 未结 5 1852
陌清茗
陌清茗 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:37

    The correct way to do this is to add the

    Vary: Cookie
    

    header on secured pages. When the user logs out, clear their session cookie. Then, when they navigate back after logging out, the browser cache will miss. This also has the benefit of not completely defeating caching.

提交回复
热议问题