AnonymousIdentificationSection.Domain 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 Cookie 網域。
public:
property System::String ^ Domain { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("domain")]
public string Domain { get; set; }
[<System.Configuration.ConfigurationProperty("domain")>]
member this.Domain : string with get, set
Public Property Domain As String
屬性值
cookie 網域名稱。 預設為空字串(“”)。
- 屬性
範例
以下程式碼範例說明如何存取該 Domain 物業。
// Get Domain.
string domain =
anonymousIdentificationSection.Domain;
Console.WriteLine("Anonymous identification domain: {0}",
domain);
' Get Domain.
Dim domain As String = _
anonymousIdentificationSection.Domain
Console.WriteLine( _
"Anonymous identification domain: {0}", domain)
備註
此屬性允許匿名識別 Cookie 在擁有共同 DNS 命名空間的網域間共享(例如所有以「contoso.com」結尾的網站)。 分享匿名身份 Cookie 必須符合以下條件:
想要分享 Cookie 的網站需要共用解密與驗證金鑰。
其他匿名識別設定屬性,如 Cookie 路徑與 Cookie 名稱,必須對所有網站相同。
欲了解更多資訊,請參閱該課程。HttpCookie