If you are starting a new web app from scratch, or you have enough time to rework your app, you can use JavaScript and AJAX to avoid the browser's history, back, and forward functions.
- Open your app in a new window, either before or immediately after login.
- If you wish, use window options to hide the nav bar (with the back and forward buttons).
- Use AJAX for all server requests, without ever changing the window's location URL.
- Use a simple web API to get data and perform actions, and render the app using JavaScript.
- There will be only one URL in the window's history.
- The back and forward buttons will do nothing.
- The window can be closed automatically on logging out.
- No information is leaked to the browser history, which can help with security.
This technique answers the question, but it also contradicts best practice in several ways:
- The back and forward buttons should behave as expected.
- An app should not open new browser windows.
- An app should still function without JavaScript.
Please carefully consider your requirements and your users before using this technique.