Solved

asp.net forms authentication not working

Posted on 2013-01-15
4
243 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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