Solved

asp.net forms authentication not working

Posted on 2013-01-15
4
235 Views
Last Modified: 2013-01-24
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:
<authentication mode="Forms">
      <forms name=".ASPXFORMSAUTH" loginUrl="~/login/login.aspx" protection="All" path="/" defaultUrl="~/main/default.aspx"/>
    </authentication>
    <authorization>
      <deny users="?"/>
    </authorization>

Open in new window

0
Comment
Question by:bigbigpig
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38779605
1: Is that all in your web.config related to authentication and authorization or are there any rules overriding the behavior?

2: Try clearing your browser cache...

3: Can you try in different browser?
0
 
LVL 10

Author Comment

by:bigbigpig
ID: 38780166
I rebooted my computer which caused me to notice I had another window open to the same site, which is hosted locally by IIS Express from VS, which may have caused the issue.  I'm going to publish it to the web server to test it out.
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38780231
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.
0
 
LVL 10

Author Closing Comment

by:bigbigpig
ID: 38815663
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!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now