protected void Application_EndRequest(Object sender, EventArgs e)
{
SessionScope scope = (SessionScope) HttpContext.Current.Items["nh.sessionscope"];
try
{
if (scope != null) scope.Dispose();
}
catch(Exception ex)
{
HttpContext.Current.Trace.Warn( "Error", "Problems with the session:" + ex.Message, ex );
}
}
}