It tourned out I had to change my NHibernateRegistry from
[...]
if (HttpContext.Current != null)
{
For<ISession>()
.HttpContextScoped()
.Use(x => x.GetInstance<ISessionFactory>().OpenSession());
}
[...]
to
[...]
if (HttpContext.Current != null)
{
For<ISession>()
.HybridHttpOrThreadLocalScoped()
.Use(x => x.GetInstance<ISessionFactory>().OpenSession());
}
[...]
The different context seems to avoid the session getting lost.