I have several controllers with SessionStateBehavior.ReadOnly to enable parallel processing of multiple ajax requests.
But I noticed that this does not stop me from writing to the session (unlike SessionStateBehavior.Disabled, which throws an exception).
My application uses Microsoft Charting, and the chart and image map is generated in response to an ajax request, where the chart is stored in the session until the image browser is displayed by the browser, after which the src image launches the browser for the request that is retrieved from the session. Thus, there is no problem trying to read from a session before writing it.
Everything works fine, I have several ajax handlers being processed in parallel, and my diagrams are returning correctly, so it matters that I declared SessionStateBehavior.ReadOnly when I write to the session?
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web.Mvc; using System.Web.UI.DataVisualization.Charting; using Mdl.Rcm.Web.Areas.Dashboards.Models; using Mdl.Web.Security; using Mdl.Persistence.UoW; using Mdl.Rcm.Business.Dashboards; using Mdl.Rcm.Business.Dashboards.Models; using Mdl.Rcm.Web.Areas.Dashboards.Charts; using Mdl.Rcm.Web.Areas.Dashboards.Charts.OrganisationConnectionsByRole; using Mdl.Web.Mvc; namespace Mdl.Rcm.Web.Areas.Dashboards.Controllers {
source share