Solved

asp.net forms authentication not working

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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 aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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