bigbigpig
asked on
asp.net forms authentication not working
I can't figure out why this doesn't work... I must be overlooking something so I need some different eyes on this.
My forms authentication isn't working. It doesn't redirect to the login page. If I manually click "login" to go to the login page and authenticate then it creates my session. But if I hit a protected page without a session then it doesn't make me authenticate. It just goes to the protected page with no session.
Here's from my web.config:
My forms authentication isn't working. It doesn't redirect to the login page. If I manually click "login" to go to the login page and authenticate then it creates my session. But if I hit a protected page without a session then it doesn't make me authenticate. It just goes to the protected page with no session.
Here's from my web.config:
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" loginUrl="~/login/login.aspx" protection="All" path="/" defaultUrl="~/main/default.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If asp.net sees a valid Formsauthentication cookie, it will take you directly to your protected page instead of login. That's what was happening with your browser window open with already authenticated user.
ASKER
Yeah that was it... I had a browser open in the background that I didn't see. Uploaded the site to the production web server and all is great. Thanks!
ASKER