Set a Different Cookie Time on Form Submission
Let's imagine you have a form inside a popup. Whenever the popup is closed, it triggers a Cookie, but what happens if the form is submitted and the popup is never technically closed? The popup will continue to Trigger and spam your users!
To make sure the popup doesn't appear again, we must setup a Cookie that is created on form submit so that the user will never see the popup again.
Setup Your Cookie
After clicking Add, you will be able to customize every aspect of how your Cookie will behave. For detailed explanations on all of the Cookie Settings and features, check out the Cookie Settings and Features Doc.
Add the code below to your functions.php, making sure to change the Popup ID #, found in the All Popups Screen, and the Cookie Name to the name of your Cookie in the Popup Editor: