I have my forms authentication system working.
I found an odd behavior such that after successful Login; I was asked to Login again, if I browse to Login page from default page.
I was assuming that it should redirect me to default page since I am already authenticated.
Here's Web.config element I used:
<authentication mode="Forms">
<forms loginUrl="login.aspx" defaultUrl="default.aspx" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
Best Answer
This is the normal behavior. The login page is a regular ASP.NET webform. It will display whatever is in it.
You could add code to the
Form_Load
event of the login page to check if the user is already authenticated. Then, you could redirect them to the default by calling theFormsAuthentication.RedirectFromLoginPage
method if that's what you are after.