I have the following code in my asp.net login page:
if (Request.QueryString["ReturnUrl"] != null)
FormsAuthentication.RedirectFromLoginPage(UserLogin.UserName, UserLogin.RememberMeSet);
else
FormsAuthentication.SetAuthCookie(UserLogin.UserName, UserLogin.RememberMeSet);
The scenario I want is:
when the user enters the login page, it will be checked if he has an authentication cookie, and if so, he is automatically redirected to the default page (which is a page that only authenticated users can see).
How can this be achieved ?