RoleManagerSection.CookieProtection Propriedade

Definição

Obtém ou define o tipo de segurança que é usado para proteger o cookie que armazena em cache os nomes dos papéis.

public:
 property System::Web::Security::CookieProtection CookieProtection { System::Web::Security::CookieProtection get(); void set(System::Web::Security::CookieProtection value); };
[System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.All)]
public System.Web.Security.CookieProtection CookieProtection { get; set; }
[<System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.All)>]
member this.CookieProtection : System.Web.Security.CookieProtection with get, set
Public Property CookieProtection As CookieProtection

Valor de Propriedade

O tipo de proteção de segurança usado no cookie onde os nomes dos papéis são armazenados em cache. A predefinição é All.

Atributos

Exemplos

O exemplo de código seguinte demonstra como usar a CookieProtection propriedade. Este exemplo de código faz parte de um exemplo maior fornecido para a RoleManagerSection classe.

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

Observações

A CookieProtection propriedade descreve como a informação num cookie é armazenada de forma segura. Pode especificar o tipo de segurança do cookie onde os papéis são armazenados em cache para a sua aplicação, definindo o atributo cookieProtection no ficheiro Web.config para a sua aplicação ASP.NET. O cookieProtection atributo assume um CookieProtection valor de enumeração de All, Encryption, None, ou Validation. A predefinição é All. Certifique-se de usar o valor predefinido da CookieProtection propriedade se quiser validação de dados e encriptação para ajudar a proteger o cookie. Para melhorar a proteção do seu cookie, pode também definir a CookieRequireSSL propriedade para true.

Aplica-se a

Ver também