AnonymousIdentificationSection.CookieProtection Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el tipo de cifrado utilizado para cifrar la cookie.
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.Validation)]
public System.Web.Security.CookieProtection CookieProtection { get; set; }
[<System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.Validation)>]
member this.CookieProtection : System.Web.Security.CookieProtection with get, set
Public Property CookieProtection As CookieProtection
Valor de propiedad
Uno de los CookieProtection valores. El valor predeterminado es All.
- Atributos
Ejemplos
En el ejemplo de código siguiente se muestra cómo acceder a la CookieProtection propiedad .
// Get CookieProtection.
System.Web.Security.CookieProtection cookieProtection =
anonymousIdentificationSection.CookieProtection;
Console.WriteLine("Cookie protection: {0}",
cookieProtection);
' Get CookieProtection.
Dim cookieProtection _
As System.Web.Security.CookieProtection = _
anonymousIdentificationSection.CookieProtection
Console.WriteLine( _
"Cookie protection: {0}", cookieProtection)
Comentarios
Para mejorar la protección de la cookie, es posible que también desee establecer la CookieRequireSSL propiedad en true.
Asegúrese de usar el valor predeterminado para esta propiedad si desea que la validación de datos y el cifrado ayuden a proteger la cookie. Esta opción usa el algoritmo de validación de datos configurado. Triple-DES (3DES) se usa para el cifrado, si está disponible y si la clave es lo suficientemente larga (48 bytes o más).