Take the community feedback survey now.

Pawan Singh
Jul 21, 2025
  473
(0 votes)

Optimizely Forms: Forcing New Submission on Every Post

By default, Optimizely Forms uses browser cookies to track submissions and updates the existing submission if the same user submits the form again. While this behavior works well in most scenarios, we had a custom business requirement: for certain forms, each submission needed to be treated as a new entry, regardless of whether it came from the same user or browser session. At the same time, all other forms in the solution were expected to retain the default cookie-based behavior.

Initially, this seemed complex
, but after inspecting the Optimizely Forms framework, we discovered that the ProgressiveSubmitInfoService class could be leveraged to inject this behavior in a clean and maintainable way, as shown below.

using EPiServer.Forms.Core.Internal;
using EPiServer.Forms.Core.Models.Internal;
namespace alloy_example.Customization.Forms;

public class ExtendedProgressiveSubmitInfoService : ProgressiveSubmitInfoService
{
    public override ProgressiveSubmitInfo GetProgressiveSubmitInfo(Guid formContentGuid, HttpContext httpContext,
        string formLanguage)
    {
        //var isPathFound = httpContext.Request.Path.StartsWithSegments(RootPath); // e.g. can be checked based on httpContext 
        if (!string.IsNullOrEmpty(httpContext.Request.Form["TestElement"]))
        {
            return null;
        }
        return base.GetProgressiveSubmitInfo(formContentGuid, httpContext, formLanguage);
    }
}

Above code check if Element TestElement is found under httpContext after submission, this it will simply return null and forcing optimizely framework to generate new submissionId for given form submission.

As last step, make sure to register in DI container as below.

using EPiServer.Forms.Core.Internal;

services.AddSingleton<ProgressiveSubmitInfoService, ExtendedProgressiveSubmitInfoService>();

This overrides the default service and enables custom logic while keeping the framework's core behavior intact.

Hope, it helps someone!

Jul 21, 2025

Comments

Please login to comment.
Latest blogs
Optimizely CMS Mixed Auth - Okta + ASP.NET Identity

Configuring mixed authentication and authorization in Optimizely CMS using Okta and ASP.NET Identity.

Damian Smutek | Oct 27, 2025 |

Optimizely: Multi-Step Form Creation Through Submission

I have been exploring Optimizely Forms recently and created a multi-step Customer Support Request Form with File Upload Functionality.  Let’s get...

Madhu | Oct 25, 2025 |

How to Add Multiple Authentication Providers to an Optimizely CMS 12 Site (Entra ID, Google, Facebook, and Local Identity)

Modern websites often need to let users sign in with their corporate account (Entra ID), their social identity (Google, Facebook), or a simple...

Francisco Quintanilla | Oct 22, 2025 |

Connecting the Dots Between Research and Specification to Implementation using NotebookLM

Overview As part of my day to day role as a solution architect I overlap with many clients, partners, solutions and technologies. I am often...

Scott Reed | Oct 22, 2025