I have 2 pages : Login.aspx and Default.aspx in my root directory www. I am redirected from Login.aspx to Default.aspx if authentication is correct. Its working perfectly.
But if I write the url http://localhost:4188/www/Default.aspx on new tab of the web browsers address bar, it directly showed the the Default.aspx without redirect to Login.aspx.
My web config file is as follows:
<authentication mode="Forms">
<forms defaultUrl="default.aspx" loginUrl="~/login.aspx" timeout="20"></forms>
</authentication>
<authorization>
<allow users="user"/>
<deny users="*"/>
</authorization>
Reason may be you already logged in. try to reduce the timeout and check after sometime.
Or try
http://localhost:4188/www/Default.aspxfrom another browser.If one of above working correctly this is not a issue. Since you are already logged in even in new tab of the same browser you are redirected to default page. If you try to log off and access default page, then application will redirect you to login page.