gw-cache-buster.php
: Fixed issue with Cache Buster not clearing cookies with Paypal checkout and Nested entry.
#849
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2630007391/67768/
Summary
When Cache Buster is enabled, Nested Form fields are not being cleared when paying for a form using PayPal.
Loom demonstrating the issue: https://www.loom.com/share/4816b6c7728a416083cfc706b28ff54a?sid=540ba7fe-133d-4e13-b4fb-b00912b4a181
When we submit form with Stripe checkout,
GPNF_Session::get_session_path
gets the correct session path, however, the same on paypal isn't true. It gets an empty session path.GPNF_Session::delete_cookie
(L180) relies on getting correct cookie to delete it. Since, the session path isn't correct with paypal it fails. This only happens with Cache Buster.xDebug snapshot with Stripe:
xDebug snapshot with Paypal:
The fix proposed here is to ensure we have removed all cookies for that form in cache buster scenario.