I am struggling over this issue since yesterday.I am working on a web application which includes email service.Email includes 'link' to a certain page of that application.
Now:I have 2 scenarios:
1) If the user is logged in(in the application) already and he hit the url he got in his email,the link will open perfectly.
2) If the user is not logged in(in the application) then the url will not open and will redirect itself to the login page with the functionality added in the BaseController.
*
Now what I want is when the user logs in after hitting the url and on successfully login the user gets redirect to the link provided in the Email.
*
for eg: If the user gets an email to the detail page of an employee,So on successfully login the user gets redirect to the Detail page of the employee.
Something like appending the redirecturl to the login page.
I think rewriting url is what I should be doing.
But I dont know how can I use that in this case.Help me out.