gpt4 book ai didi

asp.net - 无cookie的属性web.config

转载 作者:行者123 更新时间:2023-12-04 23:02:26 24 4
gpt4 key购买 nike

当前,我在web.config中使用它:

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

我的问题是 UseCookies属性中的 falsecookieless有什么区别?这让我感到困惑。

最佳答案

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).


如我们所见,此 bool 模式“true”或“false”可能已被弃用

因此,如果如今“假”和“真”值仍然适用(适用于.NET Framework 2.0及更高版本),我想当您设置“假”时,它会假设将使用cookie来存储 session 标识符为 UseCookies 和“true”假设您不想将cookie存储为 UseUri

关于asp.net - 无cookie的属性web.config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19858422/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com