Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 使用带有WebForms的localhost的窗体身份验证_Asp.net_.net_Visual Studio 2012_Webforms_Forms Authentication - Fatal编程技术网

Asp.net 使用带有WebForms的localhost的窗体身份验证

Asp.net 使用带有WebForms的localhost的窗体身份验证,asp.net,.net,visual-studio-2012,webforms,forms-authentication,Asp.net,.net,Visual Studio 2012,Webforms,Forms Authentication,我正在开发一个使用表单身份验证的旧应用程序,并试图使其作为Visual Studio 2012中的一个网站在本地工作。使用http://localhost:54006/。提供图像、html等。不幸的是,在登录时,我认为存在一些cookie问题,阻止它认为我已登录。我注意到在web.config中有错误的域集合。我已将其改为localhost,但我仍然没有任何运气 <authentication mode="Forms"> <forms loginUrl="/"

我正在开发一个使用表单身份验证的旧应用程序,并试图使其作为Visual Studio 2012中的一个网站在本地工作。使用
http://localhost:54006/
。提供图像、html等。不幸的是,在登录时,我认为存在一些cookie问题,阻止它认为我已登录。我注意到在
web.config
中有错误的
集合。我已将其改为localhost,但我仍然没有任何运气

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

从Visual Studio的
http://localhost:54006/
?它不会抱怨用户名或密码不正确。它在生产中使用不同的域属性集。localhost“.localhost”的域属性是否正确

提前感谢您的帮助或指导

编辑:我只需删除域属性,而不是试图设置它,就可以让它正常工作。为什么会这样

“获取表单身份验证cookie的域的值。”“默认值是当前域。”

值为“contoso.com”

看起来是一个很好的答案(更详细)。 另一个(类似)答案。

获取表单身份验证cookie的域的值。“默认值为当前域。”

值为“contoso.com”

看起来是一个很好的答案(更详细)。 另一个(类似的)答案