次の方法で共有


sessionState の providers の add 要素 (ASP.NET 設定スキーマ)

[このドキュメントはプレビューのみを目的としており、以降のリリースで変更される可能性があります。プレースホルダーとして空白のトピックが含まれています。]

セッション状態ストア プロバイダーのコレクションにプロバイダーを追加します。

<add 
    name="provider name" 
    type="fully qualified type reference"
/>

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

属性

Description

name

必須の String 属性です。

プロバイダーのインスタンスの名前を指定します。 これは、sessionState 要素の mode 属性が Custom 値に設定されている場合に、セッション状態ストア プロバイダーとなるプロバイダーのインスタンスを識別するために、sessionState 要素の customProvider 属性で使用する値です。

type

必須の String 属性です。

SessionStateStoreProviderBase 抽象基本クラスを実装する型を指定します。

値は、アセンブリへの完全限定参照である必要があります。

子要素

なし。

親要素

要素

Description

configuration

共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルのルート要素です。

system.web

構成ファイルの ASP.NET 構成設定のルート要素を指定します。ASP.NET Web アプリケーションを構成する構成要素やアプリケーションの動作を制御する構成要素が含まれます。

sessionState

現在のアプリケーションのセッション状態設定値を構成します。

providers

カスタム セッション状態ストア プロバイダーのコレクションを格納します。

解説

add 要素は、providers 要素に格納されているセッション状態ストア プロバイダーのコレクションにプロバイダーを追加します。 providers 要素は、カスタム セッション状態ストア プロバイダーのコレクションを格納します。 カスタム セッション状態ストア プロバイダーは、SessionStateStoreProviderBase クラスから継承する必要があります。

アプリケーション コード内の sessionState 要素の構成値のアクセスおよび変更方法については、ProviderSettingsCollection および Providers を参照してください。

使用例

カスタム セッション状態ストア プロバイダーを使用するように構成された ASP.NET アプリケーションの Web.config ファイルの使用方法を次のコード例に示します。 サンプル プロバイダーを含む、セッション状態ストア プロバイダーの実装方法については、「Implementing a Session State Store Provider」を参照してください。

<configuration>
  <connectionStrings>
    <add name="OdbcSessionServices" connectionString="DSN=SessionState;" />
  </connectionStrings>

  <system.web>
    <sessionState 
      cookieless="true"
      regenerateExpiredSessionId="true" 
      mode="Custom"
      customProvider="OdbcSessionProvider">
      <providers>
        <add name="OdbcSessionProvider"
          type="Samples.AspNet.Session.OdbcSessionStateStore"
          connectionStringName="OdbcSessionServices" 
          writeExceptionsToEventLog="false" />
      </providers>
    </sessionState>
  </system.web>
</configuration>

要素情報

構成セクション ハンドラー

SessionStateSection

構成メンバー

Providers

構成できる場所

Machine.config

ルート レベルの Web.config

アプリケーション レベルの Web.config

要件

Microsoft Internet Information Services (IIS) バージョン 5.0、5.1、または 6.0

Microsoft .NET Framework Version 2.0

Microsoft Visual Studio 2003 または Visual Studio 2005

参照

処理手順

How to: Configure Specific Folders Using Location Settings

How to: Lock ASP.NET Configuration Settings

Reference

sessionState の providers 要素 (ASP.NET 設定スキーマ)

sessionState の providers の clear 要素 (ASP.NET 設定スキーマ)

sessionState の providers の remove 要素 (ASP.NET 設定スキーマ)

sessionState の providers 要素 (ASP.NET 設定スキーマ)

sessionState 要素 (ASP.NET 設定スキーマ)

system.web 要素 (ASP.NET 設定スキーマ)

configuration 要素 (全般設定スキーマ)

System.Configuration

System.Web.Configuration

SessionStateSection

ProviderSettingsCollection

Providers

SessionStateStoreProviderBase

概念

Implementing a Session-State Store Provider

Securing Session State

ASP.NET Configuration File Hierarchy

Securing Configuration

Configuration Inheritance

その他の技術情報

Protected Configuration

全般構成設定 (ASP.NET)

ASP.NET 構成設定

Configuring ASP.NET Applications

ASP.NET Configuration API