I'v a site with jQuery Mobile multi page layout.
After AJAX login from #Login page user redirects to #CustomerDashboard or #AdminDashboard despending on the user type.
$.mobile.changePage("#CustomerDashboard", { changeHash: true });
My issue is that when user press back button the #Login page will be again displayed, and user can again login.
How can I prevent this?
if I removed the Login page using $("#Login").remove(); back button still shows the login page renderd!
#Login page cannot be removed fully because when user signs out, i need to show the login form again. This can be prevented by saving the Login page HTML and injecting back to DOM after signout.
But even though Login page is removed it remains in the browser history.
if I detect an active session exists on login page and redirects the user back to dashboard, user will not be never reach the page/site that he visited before coming to my site