PHPackages                             bigfork/silverstripe-form-idempotency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bigfork/silverstripe-form-idempotency

ActiveSilverstripe-vendormodule

bigfork/silverstripe-form-idempotency
=====================================

Idempotency key support to help prevent duplicate form submissions

1.0.1(2y ago)0406↓100%BSD-3-ClausePHPPHP ^8.0

Since Sep 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/bigfork/silverstripe-form-idempotency)[ Packagist](https://packagist.org/packages/bigfork/silverstripe-form-idempotency)[ RSS](/packages/bigfork-silverstripe-form-idempotency/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Silverstripe Form Idempotency
=============================

[](#silverstripe-form-idempotency)

> Idempotence is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. [Wikipedia](https://en.wikipedia.org/wiki/Idempotence)

This module is designed to help prevent duplicate form submissions, particularly when users click a submit button repeatedly in a short period. For standard HTML forms this will result in the browser “cancelling” previous POST request(s) and submitting new ones, however if the server has already begun processing the request then this comes too late to prevent the POST submissions being handled multiple times.

Note that this is not a replacement for spam protection, in fact this is designed specifically for forms *without* spam protection as many spam protectors will already ensure a form can only be submitted once.

Overview
--------

[](#overview)

- When a form is rendered, a unique “idempotency key” is generated and stored in a hidden field
- On submission, the server will check the user’s session to see if this key has already been submitted
- If the key hasn’t been seen before (i.e. the first submit), the form handler is called as usual
- The result of the form action is then serialized and stored in the session
- If the form is submitted again with the same idempotency key, the form handler is skipped and the serialized result from the session is returned

Installation
------------

[](#installation)

`composer require bigfork/silverstripe-form-idempotency`

Usage
-----

[](#usage)

Call `$form->enableIdempotency()` when constructing your form.

Limitations
-----------

[](#limitations)

- The result returned from the form handler (your “`public function doSomething()`”) is stored in the session, so it must be serializable. A typical response (e.g. a redirect `HTTPResponse`, or an `HTMLText` instance like a rendered template) is already serializable, but if you’re doing anything heavily custom you may need to check.
- If your form handler redirects, there’s a narrow window between (1) when the client receives the redirect response &amp; the browser issues a GET request to the destination, and (2) when the client receives the response from the GET request to the destination. If the user clicks submit again within this window, session messages (such as form or “flash” messages) may be lost, as the GET request will cause them to be rendered and cleared. This is rare, and the cached response described above will still be returned, but if you rely on one-time session messages being displayed as feedback then it’s possible these may not always appear.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

955d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/203294386?v=4)[-&gt; lozcalver](/maintainers/kinglozzer)[@kinglozzer](https://github.com/kinglozzer)

---

Top Contributors

[![lozcalver](https://avatars.githubusercontent.com/u/1655548?v=4)](https://github.com/lozcalver "lozcalver (1 commits)")

### Embed Badge

![Health badge](/badges/bigfork-silverstripe-form-idempotency/health.svg)

```
[![Health](https://phpackages.com/badges/bigfork-silverstripe-form-idempotency/health.svg)](https://phpackages.com/packages/bigfork-silverstripe-form-idempotency)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5163.4M1.3k](/packages/silverstripe-cms)[silverstripe/graphql

GraphQL server for SilverStripe models and other data

512.4M21](/packages/silverstripe-graphql)[silverstripe/admin

SilverStripe admin interface

262.6M325](/packages/silverstripe-admin)[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)[silverleague/ideannotator

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

4768.0k43](/packages/silverleague-ideannotator)[silverstripe/superglue

102.2k](/packages/silverstripe-superglue)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
