2011-01-06 13 views
2

私は非常によく似たカスタムSessionIDManagerを実装しようとしていますthis exampleカスタムSessionIDManagerの実装

私は、彼らが例に示したのと同じようにweb.configファイルでこれを入れている:

<system.web> 
    <httpModules> 
    <add name="SessionID" 
     type="ProjectName.WebUI.Models.CustomSessionIDManager" /> 
    </httpModules> 
    // --snip-- 
</system.web> 

しかし、私は設定エラーを取得していますウェブサイトをロードしようとしたとき:

ProjectName.WebUI.Models.CustomSessionIDManager does not implement IHttpModule.

web.configのその部分を削除すると、Webサイトはロードされますが、カスタムSessionIDManagerのオーバーライドされた部分は実行されません。

カスタムSessionIDManagerを使用するようにweb.configに正しく通知する方法を教えてください。

答えて

6

実際、私はドキュメントにバグがあると思います。 <httpModules>セクションに追加する必要はありませんが、illustrated hereとして<sessionState>セクションに追加する必要はありません。

<sessionState 
    Mode="InProc" 
    stateConnectionString="tcp=127.0.0.1:42424" 
    stateNetworkTimeout="10" 
    sqlConnectionString="data source=127.0.0.1;Integrated Security=SSPI" 
    sqlCommandTimeout="30" 
    customProvider="" 
    cookieless="false" 
    regenerateExpiredSessionId="false" 
    timeout="20" 
    sessionIDManagerType="Your.ID.Manager.Type, CustomAssemblyNameInBinFolder" 
/> 
関連する問題