I had the same problem, with fastcgi-mono-server4 + nginx and with xsp4 stand-alone, so I concluded that it must be a bug (or some non-implemented feature) in this version of mono (debian distribution 3.8-2).
I worked around the problem setting <sessionState mode="Off" />
in web.config and handling the session on the server side with a System.Runtime.Caching.MemoryCache
with keys composed from a GUID (for session ID emulation) and the actual string.
To set the cookie I wrote this override in my controller base class
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
if(HttpContext.Request.Cookies["sid"] == null
&& HttpContext.Response.Cookies["sid"] == null) {
HttpCookie htsid = new HttpCookie("sid", Guid.NewGuid().ToString());
HttpContext.Response.Cookies.Set(htsid);
}
//...
}
and I added a little helper to obtain the session ID in the same base class
internal string sid {
get {
HttpCookie htk = HttpContext.Request.Cookies["sid"];
if(htk == null) {
htk = HttpContext.Response.Cookies["sid"];
}
return htk == null ? null : htk.Value;
}
}
This solved my problem on Mono, where I do need concurrent connections from the same session and I need to keep state values per-session, but your mileage may vary.