Share via


AnonymousIdentificationSection.CookiePath 属性

定义

获取或设置 Cookie 的存储路径。

public:
 property System::String ^ CookiePath { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("cookiePath", DefaultValue="/")]
[System.Configuration.StringValidator(MinLength=1)]
public string CookiePath { get; set; }
[<System.Configuration.ConfigurationProperty("cookiePath", DefaultValue="/")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.CookiePath : string with get, set
Public Property CookiePath As String

属性值

用于用户匿名标识的 HTTP Cookie 的路径。 默认值为斜杠 (/),表示 Web 应用程序的根路径。

属性

示例

下面的代码示例演示如何访问 CookiePath 属性。

// Get CookiePath.
string cookiePath = 
    anonymousIdentificationSection.CookiePath;
Console.WriteLine("Cookie path: {0}", cookiePath);
' Get CookiePath.
Dim cookiePath As String = _
anonymousIdentificationSection.CookiePath
Console.WriteLine("Cookie path: {0}", cookiePath)

注解

属性 CookiePath 指示身份验证 Cookie 所在的位置,并与身份验证 Cookie 本身一起传输。

适用于