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

前端 未结 16 2051
感情败类
感情败类 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:02

    I don't know how to do it in ASP.NET but in PHP I would do something like:

    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Cache-Control: no-cache");
    header("Pragma: no-cache");
    

    Which forces the browser to recheck that the item, so your authentication checking should be triggered, denying the user access.

提交回复
热议问题