Redirect users after a successful login
If you use the core login module, redirecting the user to a given page (more precisely, to a menu item) is a breeze. But what if you want to do a trickier thing? For example what if you have a custom component/plugin which has a view with restricted parts, available only for logged in users, and you want the user to remain on the same page after the login (for example from a login box shown in a modal box)?
Tricky, eh? Took me some hours of trial and error, digging around forums and such, but here is the Joomla coding trick which will offer you a simple solution: