is it possible that after a user have logged in on my site, then he pressed the back button, it will not go to the previous page or the login page again else it will be replace by another page?
2 Answers
As soon as user is logged in, create a new session.
When the login page is loaded, check the session for login information. If user is logged in, redirect to desired page. Otherwise, don't do anything, just display login page.
-
-
1@amidamru, this depends a lot on how you are handling your authentication. Assuming you are using standard sessions, see tizag.com/phpT/phpsessions.php. Then for a redirect, set the
Location
HTTP header. php.net/manual/en/function.header.php– BradNov 21, 2010 at 7:24
On the code to load the login page, you can detect if the user is logged in, and if so, redirect to the desired page. How this redirect is done will depend on what framework you're using, if any.