Bearbeiten

Freigeben über


FormsAuthenticationConfiguration.Domain Property

Definition

Gets or sets the domain name to be sent with forms authentication cookies.

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

Property Value

The name of the domain for the outgoing forms authentication cookies. Default is an empty string.

Attributes

Examples

The following code example shows how to access the Domain property. Refer to the code example in the FormsAuthenticationConfiguration class topic to learn how to get the section.

// Get the current Domain.
string currentDomain =
    formsAuthentication.Domain;

// Set the current Domain
formsAuthentication.Domain = "newDomain";
' Get the current Domain.
Dim currentDomain As String = formsAuthentication.Domain

' Set the current Domain
formsAuthentication.Domain = "newDomain"

Remarks

The Domain is used for the authentication cookies.

This property corresponds to the value of HttpCookie.Domain.

This setting will take precedence over the domain attribute of the forms section for forms authentication cookies.

Applies to