SessionStateSection.CookieName 属性

定义

获取或设置 Cookie 名称。

public:
 property System::String ^ CookieName { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("cookieName", DefaultValue="ASP.NET_SessionId")]
public string CookieName { get; set; }
[<System.Configuration.ConfigurationProperty("cookieName", DefaultValue="ASP.NET_SessionId")>]
member this.CookieName : string with get, set
Public Property CookieName As String

属性值

String

用于会话标识的 HTTP Cookie 名称。

属性

示例

下面的代码示例演示如何获取 CookieName 属性。 请参阅类主题中的 SessionStateSection 代码示例,了解如何获取该部分。

// Display the current CookieName property value.
Console.WriteLine("CookieName: {0}",
  sessionStateSection.CookieName);
' Display the current CookieName property value.
Console.WriteLine("CookieName: {0}", sessionStateSection.CookieName)

注解

默认值是 "ASP.NET_SessionId"

适用于