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.

備註

HttpCookieMode列舉是用來指定設定 cookieless 區段中的屬性值 sessionStateThe 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.

適用於

另請參閱