I have the follow problem. This is the situation i've got when user login the application and register History. The workflow is: 1. There is a checking if user is already login- meaning if user object is in the session if not then login form is loaded and a new token is added (History.newItem("login")) if yes then the user is free to enter the main form in the application and a token is added (History.newItem("main")). After user enter pass and user successfully then a new token is added (History.newItem(main)) and enter the application main form.
And here is the problem, after main form is displayed and user decide to click "Back" in the browser then "login" token is taken from the stack and login form is loaded. But let assume user decide to click on "Forward " browser button and then "main" token is taken and main form displayed. I don't like this scenario and want to do : After "back" button to appear a Dialog box and ask "Leave application?" with "Yes" and "No" button but i can't identify when i have regular login or "back/forward" login in order to do some action.
Any advice or approaches.. probably my design is wrong..
Any way to distinguish back or forward action?