FormsAuthentication.CookieDomain属性 [英] FormsAuthentication.CookieDomain property

查看:655
本文介绍了FormsAuthentication.CookieDomain属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Q1


FormsAuthentication.CookieDomain属性指定该Cookie有效的域。如果您要在您的网络服务器上为更多应用程序启用Cookie,则覆盖此属性非常有用

FormsAuthentication.CookieDomain property specifies the domain for which this cookie is valid. Overriding this property is useful if you want to enable the cookie to be used for more applications on your web server

quote表示如果使用相同的浏览器登录到两个Web应用程序,则覆盖此属性将导致这两个应用程序将其票据放入同一身份验证Cookie?

A) I assume the quote is suggesting that if same browser is used to log onto two web applications, then overriding this property will cause these two applications to put their tickets into same authentication cookie?

B )不是以上引用暗示如果我们只有一个Asp.Net应用程序在我们的Web服务器上运行,那么我们不需要覆盖默认值(这是一个空字符串)?

B) Doesn’t above quote imply that if we only have one Asp.Net application running on our web server, then we don’t need to overwrite the default value (which is an empty string)?

但据我所知,即使我们只有一个Asp.Net应用程序在我们的Web服务器上运行,我们仍然需要将此属性设置为一个表示我们的域的值,否则表单认证不会工作?!

But as far as I know, even if we only have one Asp.Net application running on our web server, we would still need to set this property to a value representing our domain, else forms authentication would not work?!

推荐答案

正确。如果您只有一个应用程序,但不需要设置它,则不需要重写值。

Correct. You don't need to override the value if you only have one application, but you don't need to set it either, it is worked out for you.

真的这是针对您可能在 http://www.example.com 上有一个应用程序的情况, a href =http://host1.example.com =nofollow noreferrer> http://host1.example.com - 将Cookie网域设置为example.com意味着他们将共享同一个Cookie 。

Really this is for situations where you may have one application on http://www.example.com and one on http://host1.example.com - setting the cookie domain to example.com means they will share the same cookie.

这篇关于FormsAuthentication.CookieDomain属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆