[eluser]ericbae[/eluser]
Here is the basic flow I want to achieve in my app.
1. user goes to a specific URL ABCD
2. since the URL requires user's authentication, it takes user to a login page and saves the url ABCD in session somewhere.
3. user logs in, then the site takes user back to url ABCD, which is what they originally wanted.
Now, what is the best practice for achieving this? (If there is any). I think logging in and then checking whether there is a URL in the session or not is a simple check that needs to be done on my authentication library (tank_auth for that matter).
But how about "saving" the url? In each controller methods, do I have to do
if( user_is_logged_in )
{
load->view('abcd');
}
else
{
save_to_session('abcd')
redirect "auth/login"
}
??
Any ideas?