Do friendly forwarding

When people try to access a protected page and then need to be redirected elsewhere to log in, they want to go to that page once they finally log in — not some default page like their own. This implements that sort of functionality.