1

I am working on an old application that uses Forms Authentication and I'm trying to get it working locally as a web site in Visual Studio 2012. It seems to run OK using the internal debugger on http://localhost:54006/. Images, html, etc are served out. Unfortunately with login, I think there is some cookie issue that is preventing it from thinking I'm logged in. I noted that in the web.config there was the wrong domain set. I've changed that to read localhost, but I still haven't had any luck.

<authentication mode="Forms">
        <forms loginUrl="/" path="/" slidingExpiration="true" timeout="480" name=".ASPXAUTH_ADD" domain=".localhost" enableCrossAppRedirects="true">
        </forms>
    </authentication>

Does that setting look okay for running this from Visual Studio at http://localhost:54006/? It does not complain about a bad username or password. It works in production with a different domain attribute set. Is the correct domain attribute for localhost ".localhost"?

Thanks in advance for any help or guidance.

EDIT: I was able to get it working by simply removing the domain attribute rather than trying to set it. Why does that work?

user49438
  • 889
  • 7
  • 20

1 Answers1

0

"Gets the value of the domain of the forms-authentication cookie." "The default value is the current domain."

the msdn example gives the value "contoso.com."

looks like a good top answer here (more detail). another (similar) answer here.

Community
  • 1
  • 1
wazz
  • 4,953
  • 5
  • 20
  • 34