Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asp.net forms authentication not working

Posted on 2013-01-15
4
Medium Priority
?
259 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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 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