$w.onReady(function () { // flag is not found if(!session.getItem("firstTimePopupShown")) { // open popup wixWindow.openLightbox("Cookie Alert - OLD"); // set flag for future visits session.setItem("firstTimePopupShown", "yes"); } } );