We have moved to GitHub Issues
You are viewing the read-only archive of Umbraco's issue tracker. To create new issues, please head over to GitHub Issues.
Make sure to read the blog posts announcing the move for more information.
Created by Warren Buckley 02 May 2017, 14:23:23 Updated by Shola 25 Jan 2018, 23:31:45
Tags: Gold partnerIs duplicated by: CON-1291
Subtask of: CON-1390
This has been raised to us via a customer support ticket that using a SQL based session state does not work for Umbraco Forms.
An example exception message:
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
[SerializationException: Type 'Umbraco.Forms.Core.Providers.FieldTypes.Textfield' in Assembly 'Umbraco.Forms.Core.Providers, Version=4.4.2.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.]
We will need to thoroughly test Umbraco Forms & mark classes where appropriate as [Seriliazable]
It appears that any out-of-process session mode would have this bug, not just SQLServer. For example, Redis.
I've very keen to see this one fixed, as it prevents Umbraco Forms from using an out of process session state on load balanced websites.
We have a workaround - we have set individual web servers to use in-process session state and used "sticky sessions" to ensure repeat requests are sent to the same web server. However this isn’t ideal and prevents us from reaping the full benefits of a multi-server load balanced environment along with introducing the possibility of session state data loss due to servers being taken out of load.
Just an update on this issue, this is something we will need to schedule in for the new year (due to limited time left of this year)
This is a large t-shirt sized task and will take a large amount of a sprint to go through & update the Forms codebase as needed to get it to work with a SQL Session state or Redis
PR for this is here - https://github.com/umbraco/Forms/pull/175
At first I was unable to test & reproduce this when using a SQL based SessionState, only when I put TextField
and other FieldTypes from the Umbraco.Forms.Provider
class directly into a Session & tried to retrieve it again.
== Test Notes ==
@{
var field = new Umbraco.Forms.Core.Providers.FieldTypes.Textarea();
field.Name = "My Field";
Session["myField"] = field;
}
@{
var myField = Session["myField"] as Umbraco.Forms.Core.Providers.FieldTypes.Textarea;
var fieldName = myField.Name;
}
Apply the PR to your codebase & re-run the page with the above code in it's view & ensure no YSOD is thrown
OK updated a few more classes where some were marked as [Serializable] - hopefully should have them all now. Let me know if you think I may have missed anything obvious @Shandem
tested and looks good!
That's awesome news! Any estimation on when it will be available here?: https://our.umbraco.org/projects/developer-tools/umbraco-forms/
Priority: Major
Type: Bug
State: Fixed
Assignee:
Difficulty:
Category:
Backwards Compatible: False
Fix Submitted:
Affected versions: 6.0.0, 4.4.2
Due in version: 6.0.7
Sprint: Sprint 76
Story Points: 3
Cycle: 7