0

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?

relcot
  • 1
  • Possible duplicate of [How do I detect if a user has got to a page using the back button?](https://stackoverflow.com/questions/829046/how-do-i-detect-if-a-user-has-got-to-a-page-using-the-back-button) – GrumpyCrouton Oct 02 '17 at 17:27

2 Answers2

0

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.

Nicolas P.
  • 581
  • 1
  • 4
  • 15
0

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.

Isaiah
  • 91
  • 6