How to Resolve ‘rest_cookie_invalid_nonce’, ‘Cookie nonce is invalid’, ‘Cookie check failed’ Errors
In This Document
Reading time: 2 minutes | Difficulty: Beginner
Overview
The messages Cookie nonce is invalid, Cookie check failed, and rest_cookie_invalid_nonce mean that the security token (nonce) sent with a payment form request was no longer valid. WordPress nonces expire after 12 hours. These errors were most often caused by a caching plugin or web host serving a cached copy of the page that held an old token.
Since WP Simple Pay 4.17.5, payment forms fetch a fresh token every time the page loads. For logged-out visitors, an expired token left in a cached page is ignored, so the form still loads and takes payments.
Prerequisites
- Access to your caching plugin’s settings, or your web host’s cache controls
How to Fix It
On WP Simple Pay 4.17.5 or Later
- Clear your site’s cache, including any cache run by your web host. Pages cached before the update still hold the old form code.
- Reload the payment form page and try again.
If only logged-in users see the error, make sure your caching plugin doesn’t serve cached pages to logged-in users. Most caching plugins skip logged-in users by default.
If the error continues, another plugin or server rule may be changing requests to your site. Follow How to Test for Theme and Plugin Conflicts.
On Earlier Versions
Update WP Simple Pay to the latest version. If you can’t update yet, make sure pages with payment forms are either not cached or not cached for longer than 12 hours:
- Set the cache limit in WP Fastest Cache
- Set the cache limit in WP Rocket
- Set the cache limit in W3 Total Cache (see Garbage Collection Interval)
- Set the cache limit in WP Super Cache (see Garbage Collection)
What’s Next?
- How to Resolve Issues Caused by Cache and Optimization Plugins – General caching guidance
- How to Resolve the ‘Coupon security check failed’ Error – A related security token error
Still have questions? We're here to help!
Last Modified: