加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 无Cookie属性web.config

发布时间:2020-12-16 07:24:54 所属栏目:asp.Net 来源:网络整理
导读:目前我在我的web.config中使用它: sessionState mode="InProc" cookieless="UseCookies" timeout="60" / 我的问题是在无Cookie属性中UseCookies和false之间有什么区别?这对我来说很困惑. 解决方法 From,http://msdn.microsoft.com/en-us/library/ms972429.
目前我在我的web.config中使用它:

<sessionState mode="InProc" cookieless="UseCookies" timeout="60" />

我的问题是在无Cookie属性中UseCookies和false之间有什么区别?这对我来说很困惑.

解决方法

From,http://msdn.microsoft.com/en-us/library/ms972429.aspx(2000,用.NET 1.0编写)

Cookieless. The cookieless option for ASP.NET is configured with this
simple Boolean setting.

现在,来自:http://msdn.microsoft.com/en-us/library/aa479315.aspx(2005,用.NET 2.0编写)

  1. “UseCookies”: As this name implies,the cookieless feature will never be used.
  2. “UseUri”: The cookieless feature will always be used.
  3. “UseDeviceProfile”: Depending on the browser making the request,the cookieless feature may or may not be used. If ASP.NET recognizes
    that the browser does not support cookies,then the cookieless feature
    will be used. Technically speaking,the two Boolean variables
    Request.Browser.Cookies and Request.Browser.SupportsRedirectWithCookie
    must both be true for ASP.NET to assume that cookies are supported by
    the browser.
  4. “AutoDetect”: In this setting,ASP.NET attempts to detect whether the browser supports cookies or not. The algorithm is a little
    complex,and I’ll lay it out in pseudo code. (The algorithm is subject
    to change in future builds).

我们可以看到,这个布尔模式“true”或“false”可能已被弃用

因此,如果“false”和“true”值现在仍然有用(对于.NET framework 2.0及更高版本),我猜当你设置“false”时,它会假定将使用cookie来存储会话标识符,因为UseCookies和“true”将假设您不希望将Cookie存储为UseUri.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读