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 來交換使用者資訊。

適用於

另請參閱