Is there a way to keep a page from rendering once a person has logged out but hit the “back” button?

前端 未结 16 2005
感情败类
感情败类 2020-12-01 05:18

I have some website which requires a logon and shows sensitive information.

The person goes to the page, is prompted to log in, then gets to see the information.

16条回答
  •  独厮守ぢ
    2020-12-01 06:22

    You could have a javascript function does a quick server check (ajax) and if the user is not logged in, erases the current page and replaces it with a message. This would obviously be vulnerable to a user whos javascript is off, but that is pretty rare. On the upside, this is both browser and server technology (asp/php etc) agnostic.

提交回复
热议问题