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

前端 未结 16 2026
感情败类
感情败类 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条回答
  •  萌比男神i
    2020-12-01 06:20

    You are looking for a no-cache directive:

    
    

    If you've got a master page design going, this may be a little bit of a juggle, but I believe you can put this directive on a single page, without affecting the rest of your site (assuming that's what you want).

    If you've got this directive set, the browser will dutifully head back to the server looking for a brand new copy of the page, which will cause your server to see that the user is not authenticated and bump him to the login page.

提交回复
热议问题