This code below pops up with an interval of 5 seconds, 10 seconds & 15 seconds and inside this box is a contact form 7 form

So when I refresh the page it goes back to 5 seconds all the time.

```
var iteration = 0;
var times = [5,10,15]
var showPopUp = function(time) {
    setTimeout(function() { 
        jQuery('.pop_timer_box').css('display','flex');
        Cookies.set('popup_box', time); 
    }, time)

}

showPopUp(times[iteration]);

jQuery('body').on('click', '.cclose_pop', function() {
    jQuery('.pop_timer_box').hide();
    iteration +=1;
    if (iteration < 3) {
      showPopUp(times[iteration])
    }
});

```

How can I make it so that when I refresh the page will will remember what it has left

and also make it all stop when contact form 7 is successfully submitted (popup will not show anymore maybe until browser exit)

Thank in advance for the help