Prevent back button after logout

前端 未结 9 1849
梦如初夏
梦如初夏 2020-12-05 08:11

I don\'t want the user to go back to secured pages by clicking back button after logging out. In my logout code, I am unsetting the sessions and redirecting to login page.Bu

9条回答
  •  旧巷少年郎
    2020-12-05 09:02

    Avoiding the user to go back is not a good reason and most of all not secure at all.

    If you test the user's session before every "admin" action made on the website, you should be fine, even if the user hit the back button, sees the cached page and tries something.

    The "ties something" will return an error since the session is no longer valid.

    Instead, you should focus on having a really secured back office.

提交回复
热议问题