无cookie的属性web.config [英] Cookieless attribute web.config

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

问题描述

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

Currently I am using this in my web.config:

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

我的问题是cookieless属性中的UseCookiesfalse有什么区别?这让我感到困惑.

My question is what is the difference between UseCookies and false in cookieless attribute? It is confusing for me.

推荐答案

从, http://msdn.microsoft.com/zh-cn/library/ms972429.aspx (2000年,用.NET 1.0编写)

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

无饼干.使用此配置ASP.NET的cookieless选项 简单的布尔设置.

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

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

Now, from: http://msdn.microsoft.com/en-us/library/aa479315.aspx (2005, written in .NET 2.0)

  1. "UseCookies":顾名思义,无cookie功能将永远不会使用.
  2. "UseUri":将始终使用无cookie功能.
  3. "UseDeviceProfile":根据使用浏览器的请求,可能会也可能不会使用无cookie功能.如果ASP.NET识别 表示浏览器不支持cookie,然后是无cookie功能 将会被使用.从技术上讲,这两个布尔变量 Request.Browser.Cookies和Request.Browser.SupportsRedirectWithCookie ASP.NET都必须同时为真,以假定Cookie受以下组件支持 浏览器.
  4. 自动检测":在此设置中,ASP.NET尝试检测浏览器是否支持cookie.算法有点 复杂,我将用伪代码对其进行布局. (算法为准 更改未来的版本).
  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"可能已被弃用

As we can see, this boolean mode "true" or "false" was probably deprecated

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

So if "false" and "true" values still work nowdays (for .NET framework 2.0 and above) I guess when you set "false" it assumes that will be used cookies for storing session identifier as UseCookies and "true" will assume that you don't want to store cookies as UseUri.

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

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