Edit

Share via


RoleManagerSection.CookieName Property

Definition

Gets or sets the name of the cookie that is used to cache role names.

public:
 property System::String ^ CookieName { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))]
[System.Configuration.ConfigurationProperty("cookieName", DefaultValue=".ASPXROLES")]
[System.Configuration.StringValidator(MinLength=1)]
public string CookieName { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))>]
[<System.Configuration.ConfigurationProperty("cookieName", DefaultValue=".ASPXROLES")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.CookieName : string with get, set
Public Property CookieName As String

Property Value

The name of the cookie used to cache role names. The default is ".ASPXROLES".

Attributes

Examples

The following code example demonstrates how to use the CookieName property. This code example is part of a larger example provided for the RoleManagerSection class.

// Display CookieName property.
Console.WriteLine("CookieName: {0}", configSection.CookieName);
' Display CookieName property.
Console.WriteLine("CookieName: {0}", configSection.CookieName)

Remarks

The CookieName property returns the name of the cookie that is used to cache role names. You can specify the name of the cookie where roles are cached for your application by setting the cookieName attribute in the Web.config file for your ASP.NET application. This is useful when you want to uniquely identify a cookie for your application or when a cookie is shared across multiple applications.

Applies to