次の方法で共有


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 、Cookie 内の情報を安全に格納する方法を示します。 ASP.NET アプリケーションのWeb.config ファイルで 属性を設定 cookieProtection することで、アプリケーションに対してロールがキャッシュされる Cookie のセキュリティの種類を指定できます。 属性はcookieProtectionCookieProtection、または ValidationAllEncryptionNone列挙値を受け取ります。 既定値は、All です。 Cookie の保護に役立つデータ検証と暗号化の両方が CookieProtection 必要な場合は、 プロパティの既定値を使用してください。 Cookie の保護を強化するために、 プロパティを CookieRequireSSLtrue設定することもできます。

適用対象

こちらもご覧ください