- Put an identifier for the page they are coming from in a hidden input in the form.
- Copy it to the form you show on a "Login failed, try again" situation (if there is a failed login, otherwise go directly to 3).
- Use that identifier to determine the URL to redirect to with a
Location:
header after a successful login
How do i redirect a user to the previous page they came from after logging in? HTML/ASP
-
27-06-2023 - |
Question
Hi i need to redirect my users to the same page they were just on after logging into my site, the redirectory code will obviously be a different page depending on the page tehy were last at, any help would be appreciate :)
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow