easiest way to prevent the back button of your browser from showing secure data after a user logs out?

后端 未结 6 514
天涯浪人
天涯浪人 2020-12-09 11:55

In a normal web app w/ login and secure data, what is an easy way to secure that data and prevent it from being seen by using the browser\'s back button, once a user logs ou

6条回答
  •  余生分开走
    2020-12-09 12:00

    There is no perfect solution

    Although there are some very reasonable solutions to this (cache control headers, javascript, etc), you need to realise that once you have sent something to a client, it is out of your control. You cannot guarantee that the client will treat the data in the way you would like.

    For example:

    • there could be a bug in a browser
    • a browser might allow users to turn off cache control
    • a user might be running with javascript disabled

    Sorry :(

提交回复
热议问题