FormsAuthentication.FormsCookiePath 属性

定义

获取 Forms 身份验证 Cookie 的路径。

public:
 static property System::String ^ FormsCookiePath { System::String ^ get(); };
public static string FormsCookiePath { get; }
member this.FormsCookiePath : string
Public Shared ReadOnly Property FormsCookiePath As String

属性值

String

存储 Forms 身份验证票证信息的 Cookie 的路径。 默认值是“/”。

示例

下面的代码示例使用pathWeb.config文件中的属性设置FormsCookiePath属性值。

<authentication mode="Forms">
  <forms loginUrl="member_login.aspx"
    cookieless="UseCookies"
    path="/MyApplication" />
</authentication>

注解

属性值FormsCookiePath使用窗体配置元素的属性在 ASP.NET 应用程序的path配置文件中设置。 Path指定FormsCookiePath用于存储FormsAuthenticationTicket信息的 Cookie。

适用于

另请参阅