Table of contents
Custom Session Extension
The Custom Session extension allow you to plug a custom implementation for the session available on IRailsEngineContext. This can be useful if you have requirements to implement on a session that ASP.Net Session strategies can not fulfil.
Using the extension
In order to use this extension you must provide an implementation of ICustomSessionFactory which would be responsible to create your own session implementation. A really naive implementation could map some cookie value to an instance of Hashtable, for instance.
Extensions were introduced to allow the framework to be extended easily and extensions to be reused.
Changing MonoRail configuration
You need to install the extension using the extensions node, as usual, and also provide the attribute customsession to inform the type that implements ICustomSessionFactory as follows:
<monorail customsession="Type name that implements ICustomSessionFactory"> <extensions> <extension type="Castle.MonoRail.Framework.Extensions.Session.CustomSessionExtension, Castle.MonoRail.Framework" /> </extensions> </monorail>