다음을 통해 공유


RoleManagerSection.CookieProtection 속성

정의

역할 이름을 캐시하는 쿠키를 보호하는 데 사용되는 보안 유형을 가져오거나 설정합니다.

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

속성 값

역할 이름이 캐시되는 쿠키 내에서 사용되는 보안 보호 유형입니다. 기본값은 All입니다.

특성

예제

다음 코드 예제에서는 속성을 사용 하는 방법을 보여 줍니다 CookieProtection . 이 코드 예제는 클래스에 제공된 더 큰 예제의 RoleManagerSection 일부입니다.

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

설명

이 속성은 CookieProtection 쿠키의 정보를 안전하게 저장하는 방법을 설명합니다. ASP.NET 애플리케이션에 대한 Web.config 파일의 특성을 설정 cookieProtection 하여 애플리케이션에 대한 역할이 캐시되는 쿠키의 보안 유형을 지정할 수 있습니다. 특성은 cookieProtection , EncryptionNone또는 Validation.의 All열거형 값을 사용합니다CookieProtection. 기본값은 All입니다. 데이터 유효성 검사와 암호화를 모두 사용하여 쿠키를 CookieProtection 보호하려면 속성의 기본값을 사용해야 합니다. 쿠키 보호를 개선하기 위해 속성을 true.로 설정할 CookieRequireSSL 수도 있습니다.

적용 대상

추가 정보