Bug 3012 - SessionStateBehaviour in HttpContext is ignored
Summary: SessionStateBehaviour in HttpContext is ignored
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-01-23 06:58 UTC by Dan Parnham
Modified: 2013-03-11 00:26 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 3012 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

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.