HttpCookieMode 枚举

定义

指定如何将 Cookie 用于 Web 应用程序。Specifies how cookies are used for a Web application.

public enum class HttpCookieMode
public enum HttpCookieMode
type HttpCookieMode = 
Public Enum HttpCookieMode
继承
HttpCookieMode

字段

AutoDetect 2

ASP.NET 确定请求浏览器或设备是否支持 Cookie。ASP.NET determines whether the requesting browser or device supports cookies. 如果请求浏览器或设备支持 Cookie,则 AutoDetect 使用 Cookie 来保持用户数据;否则在查询字符串中使用标识符。If the requesting browser or device supports cookies then AutoDetect uses cookies to persist user data; otherwise, an identifier is used in the query string. 如果浏览器或设备支持使用 Cookie,但当前 Cookie 被禁用,请求功能仍将使用 Cookie。If the browser or device supports the use of cookies but cookies are currently disabled, cookies are still used by the requesting feature.

UseCookies 1

使用 Cookie 保持用户数据,无论浏览器或设备是否支持 Cookie。Cookies are used to persist user data regardless of whether the browser or device supports cookies.

UseDeviceProfile 3

ASP.NET 根据 HttpBrowserCapabilities 设置来确定是否使用 Cookie。ASP.NET determines whether to use cookies based on HttpBrowserCapabilities setting. 如果该设置指示浏览器或设备支持 Cookie,则使用 Cookie;否则在查询字符串中使用标识符。If the setting indicates that the browser or device supports cookies, cookies are used; otherwise, an identifier is used in the query string.

UseUri 0

该调用功能使用查询字符串来存储标识符,无论浏览器或设备是否支持 Cookie。The calling feature uses the query string to store an identifier regardless of whether the browser or device supports cookies.

注解

枚举用于指定sessionState配置节中cookieless特性的值。 HttpCookieModeThe HttpCookieMode enumeration is used to specify the value of the cookieless attribute in the sessionState configuration section. 它由所有支持无 cookie 身份验证的功能使用。It is used by all features that support cookieless authentication.

HttpCookieMode枚举值指定如何使用 cookie 来维护有关用户的信息。The HttpCookieMode enumeration values specify how a cookie should be used to maintain information about the user. 使用 "自动检测" 时, ASP.NET 会查询浏览器或设备, 以确定它是否支持 cookie。When AutoDetect is used, ASP.NET queries the browser or device to determine whether it supports cookies. 如果浏览器或设备支持 cookie, 则使用 cookie 来持久保存用户数据;否则, 在查询字符串中使用标识符。If the browser or device supports cookies, then cookies are used to persist user data; otherwise, an identifier is used in the query string.

适用于

另请参阅