FormsAuthenticationConfiguration.Cookieless 屬性

定義

取得或設定一個值,指示表單式驗證是否應該使用 Cookie。

public:
 property System::Web::HttpCookieMode Cookieless { System::Web::HttpCookieMode get(); void set(System::Web::HttpCookieMode value); };
[System.Configuration.ConfigurationProperty("cookieless", DefaultValue=System.Web.HttpCookieMode.UseDeviceProfile)]
public System.Web.HttpCookieMode Cookieless { get; set; }
[<System.Configuration.ConfigurationProperty("cookieless", DefaultValue=System.Web.HttpCookieMode.UseDeviceProfile)>]
member this.Cookieless : System.Web.HttpCookieMode with get, set
Public Property Cookieless As HttpCookieMode

屬性值

這是其中一項 HttpCookieMode 價值。 預設值為 UseDeviceProfile

屬性

範例

以下程式碼範例示範如何存取該 Cookieless 物業。 參考課堂主題中的 FormsAuthenticationConfiguration 程式碼範例,了解如何取得該章節。

// Get current Cookieless.
System.Web.HttpCookieMode currentCookieless =
    formsAuthentication.Cookieless;

// Set current Cookieless.
formsAuthentication.Cookieless =
    HttpCookieMode.AutoDetect;
' Get current Cookieless.
Dim currentCookieless _
As System.Web.HttpCookieMode =
formsAuthentication.Cookieless

' Set current Cookieless.
formsAuthentication.Cookieless = HttpCookieMode.AutoDetect

備註

Cookieless 特性定義了表單式認證是否應該使用 cookie 來交換使用者資訊。

適用於

另請參閱