redirect to original url after authentication using a session variable