FormsAuthentication.RequireSSL プロパティ

フォーム認証の Cookie をサーバーに返すために SSL を必要とするかどうかを示す値を取得します。

名前空間: System.Web.Security
アセンブリ: System.Web (system.web.dll 内)

構文

'宣言
Public Shared ReadOnly Property RequireSSL As Boolean
'使用
Dim value As Boolean

value = FormsAuthentication.RequireSSL
public static bool RequireSSL { get; }
public:
static property bool RequireSSL {
    bool get ();
}
/** @property */
public static boolean get_RequireSSL ()
public static function get RequireSSL () : boolean
適用できません。

プロパティ値

フォーム認証の Cookie をサーバーに返すために SSL を必要とする場合は true。それ以外の場合は false。既定値は false です。

解説

RequireSSL プロパティ値は、ASP.NET アプリケーションの構成ファイル内の forms 構成要素の requireSSL 属性を使用して設定されます。ASP.NET アプリケーションの Web.config ファイルで requireSSL 属性を設定することにより、フォーム認証の Cookie をサーバーに返すために SSL (Secure Sockets Layer) が必要かどうかを指定できます。詳細については、「Secure」を参照してください。

requireSSLfalse として構成する場合は、slidingExpirationfalse に設定し、チケットが有効である期間を制限することをお勧めします。

使用例

Web.config ファイルの requireSSL 属性を設定するコード例を次に示します。

<authentication mode="Forms">
  <forms loginUrl="member_login.aspx"
    cookieless="UseCookies"
    requireSSL="true"
    path="/MyApplication" />
</authentication>

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1

参照

関連項目

FormsAuthentication クラス
FormsAuthentication メンバ
System.Web.Security 名前空間

その他の技術情報

ASP.NET Web アプリケーションのセキュリティ