I have this web application which does the following as standard to all websites
- Users browse to any page on the website
- They click on login link on header from any page
- Visit login page and then login and get directed to their logged in page
- IF user then hits back button they get to login page and that redirects to home (because they are already logged in).
How do I change at javascript or php level for the following
- Users browse to any page on the website
- They click on login link on header from any page
- Visit login page and then login and get directed to their logged in page
- IF user then hits back button they will get to the page they visited just before the login page was seen.
Thanks
There are a few ways to do this, the easiest:
1. Change the way your login process script redirects, if you change the location header then the web browser will ignore that page when the user goes back. In php it’s as easy as
or
2.Use An AJAX login system, so rather than going from home->loginpage->profilepage you could have an in-page popup box that allows the user to login inside the homepage.
Either way, as an ease of use feature, you should probably send the user back to the homepage after login, and then there is no need to use the back button – on the new home page simply have “Welcome Bob, Profile Links Merged With Home Page, etc” added when a user is detected.
Hope that helps 🙂