Suppose user is travelling HomePage => Page2 => LoginPage => Page2 (after logging)
Now if user press back button he should back to HomePage (not to LoginPage) What's the best way to doing this?
Suppose user is travelling HomePage => Page2 => LoginPage => Page2 (after logging)
Now if user press back button he should back to HomePage (not to LoginPage) What's the best way to doing this?
A good way to do this is to implement some kind of redirection logic that'd be triggered when user lands on LoginPage. If he's logged in, go back to HomePage.
In your session variables, add something to signify that that user has logged in, doing the same in your database as well. Then in your login page, redirect to whichever page you want them to if that user is still signed in, checking both the session and the database.