Reputation: 14931
Our application forbids going back for several reasons. Basically because that's just how our application works (JSF with facelets as GUI) You always have to enter on the welcome site, once you chose an application-flow you can only leave / abort when you tell the application (e.g. press a button). If you just browse away e.g. enter "example.com" in the address bar the state of your flow gets saved and once you relogin, you can resume the work. Going back is only possible when it was specifically designed like this with a 'back' submit - button. Of course users keep pressing the 'back' button (i would do so as well) and they keep getting 'error: session out of synch'. This is a learning process and a couple years ago we just disabled the back-button to make things clear. Sadly this is no longer supported. So instead of teaching the user the hard way and forcing him to relogin, are there some good alternatives I'm missing?
i found this link which should offer 3 methods to disable the back button - but in reality it just further confirms the fact that it is impossible to do it in a semi-nice way.
Upvotes: 1
Views: 1403
Reputation: 3759
You might find a workable solution here How do I insert an entry into browsing history via JavaScript by inserting an extra step into the browser's history (perhaps a link to the current page with query string parameters that result in a nice big red box message to the user), or you could try attaching an event handler to the OnBeforeUnload event so the user gets a confirmation dialog when trying to leave the page (you'd want to remove the handler when the submit button was clicked).
Upvotes: 1
Reputation: 48186
when the user tries to go to a previous page you can redirect him to the page he should be at in other words catch the "out of sync" and redirect him
Upvotes: 2