This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.

Bug 3012

Summary: SessionStateBehaviour in HttpContext is ignored
Product: [Mono] Class Libraries Reporter: Dan Parnham <dan.parnham>
Component: Sys.WebAssignee: Bugzilla <bugzilla>
Status: NEW ---    
Severity: normal CC: admin, mono-bugs+mono
Priority: ---    
Version: 2.10.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Dan Parnham 2012-01-23 06:58:22 UTC
We have been attempting to find our way around the bug http://bugzilla.xamarin.com/show_bug.cgi?id=381 which we have been struggling with for the best part of a year now. 

In the next iteration of our application we will need sessions enabled, but they are only required for specific controllers, so if we can disable it for the ones that handle the heavy polling it should avoid the memory leak.

Since we are using the MVC3 and it now supports session-less controllers (easily configured through the SessionState attribute), we thought this would be an ideal way to implement session disabling where required.

However, when I set the attribute in our test application it appears to have no effect whatsoever, in fact I can still write things to the session (this should be throwing an exception according to the examples on the MVC3 website).

Having dived into the MVC code and then followed the chain into the mono sources I found that the .NET 4 function SetSessionStateBehavior has been implemented in HttpContext.cs and yet it appears that absolutely nothing is done with the stored value. This means that, although an MVC3 application builds and runs, the setting of the session state behaviour silently does nothing.
Comment 1 plusapps 2013-03-11 00:26:38 UTC
We are also facing the same issue. HttpContext.SetSessionBehavior() call don't have any effect.