How can I prevent a user from going to the previous page

I design a simple email portal as my college assignment, and I turn to gmail for various functions. Now, when we log in to the gmail account, and then, if we click the back button of the browser, we still remain on the Inbox page. In my case, after logging in, if I click the "Back" button, I will return to the login page. Please suggest how I can achieve this. I'm also new to ASP.NET, so keep it detailed

+3
source share
2 answers

The trick is to use the javascript function "history.replace (...)":

http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript

Essentially, you delete previous history entries.

+2
source

Very simple. When loading the login page, check the current state of the user session, and if they are already logged in, redirect them to your inbox.

+4
source

Source: https://habr.com/ru/post/1742729/


All Articles