1. There is a password protected page.
  2. There is a link in the single page, clicking on it opens the "Popup Maker" modal window.
  3. Content from the password-protected page from point 1 is loaded into this modal window.
  4. If the password was not entered or entered incorrectly in the modal window there is a form for entering the password, if the password is entered correctly, we see the necessary content.

Everything works correctly, except for one thing, after the user entered the correct password, the page reloads and this is where everything ends. To see the content, you need to click on the link from point 2 again. This is very inconvenient.

Please tell me how to make the modal window open again immediately after entering the password and reloading the page, as well as at any time by clicking on the link from paragraph 2?

1 Answer 1


I solved the problem in this way. Maybe someone will need it.

  1. Configured the modal window so that a cookie is created when the window is closed.
  2. Launched a modal window until the user closes the window and a cookie is created.

Here is the code:

if ( ! isset( $_COOKIE["pum-909"] ) ) { ?>
        setTimeout(function() {
            PUM.open('909'); // This is my popup class "popmake-909"
        }, 1000);
<?php }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.