I am creating a basic CodeIgniter site that requires a login before you can access any site.
If the user visits the site URL, something like this:
http://www.mysite.com/project/detail/2049
And they are currently logged out, I set them to automatically turn off back to the login page.
My question is: after they logged in, what is the best way to redirect them to the source URL they typed in, instead of redirecting them to the websites homepage?
I thought maybe dynamically creating the URL as a hidden form element in the login form and redirecting there after a successful login ... What do you guys think? Is there any best / best practice for this type of dynamic redirection after login?
source
share