Solved

asp.net forms authentication not working

Posted on 2013-01-15
4
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

627 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